Code2Prompt turns a codebase into a single, templated LLM prompt with token counting — a precise tool for a precise job. What it cannot do is carry your conventions, your constraints and your prior decisions into tomorrow's session. That is the part Brainfile keeps on disk, where Claude Code reads it automatically.
Code2Prompt: a fast CLI that converts a codebase into one LLM prompt, with templating and token counting so you control exactly what gets sent.
Brainfile: a library of maintained CLAUDE.md configurations — the standing instructions Claude Code loads from your project root on every run.
A generated prompt and a standing context file are complements, not rivals. One assembles the code for a specific ask; the other makes sure every ask starts from your rules.
| Feature | Code2Prompt | Brainfile |
|---|---|---|
| Primary output | A generated prompt containing selected source | A standing context file describing how to work here |
| Loaded by Claude Code automatically | No — you paste the generated prompt | Yes — CLAUDE.md is read from the project root |
| Templating control | Strong — templates decide exactly what is included | You edit plain markdown directly |
| Persistence | None — regenerate for each new question | Persistent, and versioned with your repo |
| Encodes decisions and constraints | Only if you hand-write them into a template each time | That is the entire point of the file |
| Cost | Free and open source | Paid subscription — see the pricing page for current plans |
| Best at | Assembling a precise one-off prompt from source | Making every session start from your standards |
You want tight, templated control over exactly which files reach the model for a specific question, and you are happy to regenerate per task. It is free, fast and open source — a good tool that we are not trying to talk you out of.
The thing you keep re-typing is not code, it is context: the stack decisions, the conventions, the approaches you have already rejected. That belongs in a file the tool reads on its own.
Generate a targeted prompt with Code2Prompt when a task needs specific source in the window; keep a CLAUDE.md so your standing rules apply either way. The 3 free configurations are enough to test whether the persistent layer changes your results.
Code2Prompt is about assembly: given a question, gather the right source, shape it with a template, count the tokens, hand it over. Precision per task is the goal, and it hits it.
Brainfile is about the baseline: before any question is asked, Claude already knows the project's rules. There is nothing to assemble and nothing to paste, because the file is already where the tool looks.
Maintained CLAUDE.md configurations Claude Code loads on its own. Works with the Claude subscription you already have.
30-day money-back guarantee · Instant access · Cancel anytime
AI context engineering tips and new configuration releases. Free.
No spam. Unsubscribe anytime.