CLAUDE.md: What Claude Code Actually Reads
What is CLAUDE.md? It’s a plain Markdown file Claude Code reads at the start of every session, so you don’t have to re-explain your project each time. The project one lives at ./CLAUDE.md or ./.claude/CLAUDE.md and goes in git; your personal one lives at ~/.claude/CLAUDE.md; ./CLAUDE.local.md is for notes you keep out of git. The official memory docs, checked November 27, 2026, say to aim for under 200 lines per file.
That’s the short answer. The longer one is mostly about what not to put in it, because the CLAUDE.md files I get sent by founders are usually too long, half out of date, and full of wishes.
Where Claude Code looks, and when
There are four places, loaded from broadest to most specific:
| Scope | Where | Who sees it |
|---|---|---|
| Managed policy | /etc/claude-code/CLAUDE.md on Linux, /Library/Application Support/ClaudeCode/CLAUDE.md on a Mac | Everyone on that machine |
| User | ~/.claude/CLAUDE.md | You, in every project |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | Your team, through git |
| Local | ./CLAUDE.local.md | Only you, add it to .gitignore |
Nothing overrides anything. Claude Code walks from your working directory up to the filesystem root and concatenates every CLAUDE.md and CLAUDE.local.md it finds, root first, so the file closest to where you launched is read last. If two of them disagree, the docs are blunt about it: Claude may pick one arbitrarily.
Files in subfolders work differently. A supabase/CLAUDE.md doesn’t load at launch. It loads the first time Claude reads, writes or edits a file in supabase/. That’s useful. Your migration rules only cost context when Claude is actually near a migration.
One more detail I like: block-level HTML comments (<!-- like this -->) are stripped before the file goes into context. Leave notes for humans there and they cost nothing.
To see what actually loaded, run /context all and look under Memory files. Do this once. I’ve seen a team wonder for a week why Claude ignored their rules, and the file was called Claude.md on a case-sensitive Linux box.
What belongs in it
The docs’ own test is good: write down what you’d otherwise re-explain. Claude made the same mistake twice, a review caught something it should have known, a new developer would need the same sentence. Build and test commands, where things live, naming rules, the one weird thing about your deploy.
Make every line checkable. “Format code properly” does nothing. “Use 2-space indentation” does. “Run npm test before committing” beats “test your changes” every time, because Claude can tell whether it did it.
Here’s roughly what I write for a founder’s Vite + Supabase app on day one of our setup work. It’s short on purpose.
# Bookings app
## Commands
- Dev: `npm run dev` (port 5173)
- Tests: `npm test` (Vitest). Run before every commit.
- Types: `npx supabase gen types typescript --linked > src/types/db.ts`
## Layout
- Pages in `src/pages/`, one file per route
- All Supabase calls go through `src/lib/api/`, never from components
## Database
- New migration: `npx supabase migration new <name>`. Never edit an applied one.
- Every new table gets RLS enabled and a policy in the same migration.
- Staging is the `staging` branch project. Production is never the target of `db push`.
## Don't
- Don't add npm packages without saying why in the PR
- Don't touch `src/lib/stripe/` without a test for the webhook
Thirty-odd lines. It’ll grow, but slowly.
What doesn’t belong in it
Procedures. A twelve-step release checklist in CLAUDE.md loads into every session, including the one where you just want a button moved. The docs say multi-step procedures go into a skill, which only loads when it’s needed.
Rules for one corner of the code. Put those in .claude/rules/ with a paths field in the frontmatter, like paths: ["supabase/migrations/**"]. A path-scoped rule loads only when Claude touches a matching file. paths is the only field Claude Code reads from a rule file; anything else in the frontmatter is ignored without an error, which caught me out once with a description: I thought was doing something.
Things that must never happen. This is the big one. The docs say it directly: CLAUDE.md is context, not enforced configuration. “Never run supabase db push against production” in CLAUDE.md is a polite request that holds right up until a long session where it doesn’t. If an action must be blocked, it needs a deny rule in settings or a PreToolUse hook. I write both: the line in CLAUDE.md so Claude knows why, and the hook so it can’t.
Your README, imported whole. @README.md pulls the file into context, and imports can chain up to four hops deep. Imports help you organise; they don’t save a single token, because the imported file loads at launch with the rest. I had a client whose CLAUDE.md imported the README, which imported docs/architecture.md, which imported an API spec. About 2,400 lines loaded before anyone typed a word, and the model was visibly worse at following the three rules that mattered.

Auto memory is a different file
Claude Code also takes its own notes. That’s auto memory: a MEMORY.md index plus topic files in ~/.claude/projects/<project>/memory/, one directory per git repository, shared across worktrees. Only the first 200 lines or 25KB of MEMORY.md load at the start, whichever comes first; the topic files are read when needed.
It’s machine-local. Your teammate doesn’t get your auto memory, and neither does CI. So anything the team needs goes in CLAUDE.md, in git, where it gets reviewed. You can switch auto memory off from /memory (it saves autoMemoryEnabled) or with CLAUDE_CODE_DISABLE_AUTO_MEMORY=1.
AGENTS.md, if you use other tools too
If the repo already has an AGENTS.md for Codex or Cursor, recent Claude Code versions (v2.1.277 and later) read it when there’s no CLAUDE.md. Add a CLAUDE.md and the AGENTS.md stops loading, unless your CLAUDE.md imports it with @AGENTS.md. That import is what I do: one file of shared rules, and a tiny CLAUDE.md that imports it and adds the Claude-specific bits. Note that even a CLAUDE.local.md counts, so creating one for your own notes silently turns off AGENTS.md for you.
After /compact
People ask whether instructions vanish after compaction. The project-root CLAUDE.md doesn’t: Claude Code re-reads it from disk and puts it back. Subfolder files and path rules come back the next time Claude touches those files. If a rule you only said in chat disappeared after /compact, that’s the sign it should have been in the file.
Where we come in
/init will write you a first draft, and it’s a fine start. The hard part is knowing which of your rules need to be a hook instead, which belong in a path rule, and which are wrong about your own database. Writing that for your app is part of our AI-ready setup from $600, with hooks, deny rules, CI and a staging Supabase. If the app is already built and needs to survive real users, start with taking a Claude Code or Cursor app to production, from $500. And if you’re still working out whether building it yourself is cheaper, the app development cost calculator puts numbers on it.