Where memory lives
There is more than one CLAUDE.md, they load in a fixed order, and a second system writes notes without being asked. Knowing which is which saves an afternoon.
Four places, one order
| Scope | Where | For |
|---|---|---|
| Managed policy | /Library/Application Support/ClaudeCode/CLAUDE.md on macOS, /etc/claude-code/CLAUDE.md on Linux | Rules an organisation sets for everyone |
| User | ~/.claude/CLAUDE.md | Your preferences, in every project you open |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | The team's, committed with the code |
| Local | ./CLAUDE.local.md | Yours, for this project only. Gitignore it |
They load broadest first, so a project instruction arrives after a personal one and a specific rule sits closer to the work. Files above your working directory load at launch; files in subdirectories load when Claude reads something in that directory.
The practical split is simple. If a teammate would benefit, it goes in the project file and gets committed. If it is about you, it goes in your user file. If it is a staging URL or a personal shortcut, it goes in the local file and never gets pushed.
Rules that only apply somewhere
A large project ends up with instructions that only matter for part of it. Those go in .claude/rules/, scoped to file types or directories, rather than bloating one file that every session pays for.
The notes it writes itself
Auto memory is the other half, and it works the other way round: Claude writes it, from your corrections and the things it learns. It is stored per repository and the first 200 lines or 25KB, whichever comes first, load at the start of each session.
| CLAUDE.md | Auto memory | |
|---|---|---|
| Who writes it | You | Claude |
| What is in it | Instructions and rules | Learnings, preferences, corrections |
| When to use it | Standards, commands, architecture | Things you would rather not have to say twice |
Both are context rather than enforcement, and both are worth reading occasionally. An auto memory file that has learned something wrong will keep being wrong until you open it.
- Look at
~/.claude/CLAUDE.md. If it does not exist, write three lines you would want in every project. - Find your project's auto memory and read what Claude has decided about you.
Little by little, you're building something great.