The Three Tiers of CLAUDE.md
Set up the files Claude reads before every prompt, and get the smartest model to write yours
The Idea
Every time you send a prompt, Claude reads your CLAUDE.md files before it does anything — they're its standing orders. If what's in them is good, they quietly sharpen everything Claude does. If they're messy or bloated, they quietly make everything worse.
Most people know about one CLAUDE.md, in the project root. There are actually three tiers, and the difference between them is just reach: how much of your work each one applies to. The test for where a rule goes: is it true for everything you build? Computer level. True for this project? Project level. True for one corner of it? Folder level.
And here's why this matters more than any individual session: models come and go — you're renting them. These files are yours. Whatever the smartest model writes into them, every future session follows, whichever model it's running on.
The Three Tiers
Computer level
~/.claude/CLAUDE.mdEvery project you ever open — read at the start of every session, everywhere.
What belongs here
- →How you like to work — plain English first, ask before assuming, push back
- →Your personal defaults: package manager, language preferences
- →Workflow rules you want everywhere: “run the tests before saying done”
What doesn't: Anything about one specific project — that belongs a tier down.
Project level
your-project/CLAUDE.mdEveryone and every session in this project — read at the start of every session in this project; shared with your team via git.
What belongs here
- →What the project is, the stack, and the commands that run it
- →Where things live and the conventions that aren't obvious from the code
- →The don'ts: files never to touch, things never to commit
What doesn't: Your personal taste — keep the team file about the project, not about you.
Folder level
any-folder/CLAUDE.mdJust that corner of the project — only loaded when Claude actually works with files in that folder — costs nothing until then.
What belongs here
- →Rules that are true in this folder and nowhere else
- →“This is generated, edit the source instead” / “this folder is customer-facing copy”
What doesn't: General project rules — if it's true outside this folder, move it up a tier.
Then Make Them Yours
The templates are deliberately generic — the brackets are the point, and none of this needs doing by hand. Open Claude Code in your project and paste this: it fetches the templates, puts each file where it lives, and fills in the brackets by reading your project and asking you whatever it can't infer.
Prefer to place the files yourself? Copy each template above to the path on its card, then hand Claude this to tailor them to how you actually work:
The Power Move: Don't Write Them Yourself
The templates above are good starting points. But the real play is getting the smartest model you have access to, to write yours — it digs through your project, asks you how you work, and writes all three tiers itself. You can't keep the model, but you can keep its way of thinking: the standards it sets and how it breaks things down, written into the files every future session follows.
As I write this, that model is Fable — included on the standard plans until 7 July 2026. If you're inside that window, this is the best thing you can spend it on; if you've missed it, the play doesn't change — use the strongest model you can reach. (More ways to spend the window: the Fable list.)
That's how this page itself was made: Fable wrote the templates and the prompts on it, checked against Anthropic's own guidance on these files. The model leaves; what it wrote down stays.
Open Claude Code in your project (or a chat with the project connected) and paste this — it replaces the templates, so you don't need them in place first:
The Rules That Make These Files Work
Specific beats vague, every time
"Use 2-space indentation" gets followed. "Format code properly" gets ignored. "Run npm test before committing" gets followed. "Test your changes" gets ignored. If a rule could mean two things, it's not a rule yet. And when a rule isn't self-evident, give it its one-line why — a rule with a reason gets applied to situations you didn't think of; a bare rule gets applied literally.
Short files get obeyed, long files get skimmed
Every line is read every single session, so every line costs context — and a bloated file means the rule you actually care about gets lost in the noise. There's a real budget here: in practice models reliably follow a couple of hundred instructions at most, and Claude Code's own system prompt already spends a chunk of them. Keep each file under 200 lines. The test for every line: would Claude get something wrong without it? If not, delete it.
The tiers add together, they don't override
All three files load into the same session. If two of them contradict each other, Claude picks one arbitrarily — so never repeat a rule across tiers. Each rule lives at exactly one altitude: the highest one where it's still true.
Treat them like a garden, not a monument
When Claude makes the same mistake twice, add a rule. When you notice it already does something without being told, delete that line. If a rule keeps getting broken, mark it IMPORTANT — sparingly. These files earn their keep session after session, but only if you prune them.
Grab all three from GitHub.
Everything on this page — the three templates, the set-up prompt, the distill prompt — lives in one repo, so Claude can fetch it and you can fork it.
View the templates on GitHubWant ready-made rules for the project tier?
The Coding Guidelines CLAUDE.md — four rules built from Andrej Karpathy's notes on where AI coding goes wrong — drops straight into any project-level file: think before coding, simplicity first, surgical changes, goal-driven execution.
The Honest Bit
Writing a smarter model's thinking into these files doesn't turn a cheaper model into that model — reasoning it does live, in the moment, can't be written down. What you keep is the judgment: the standards, the structure, the way problems get broken down. In practice that's a surprising amount of what made the smart model feel smart. But if a task genuinely needs more horsepower, no file fixes that — that's what the model picker is for.