Claude CodeClaude Code 2.1 · macOS, Linux, Windows
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
31 small wins to finish your pathNext lesson

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

ScopeWhereFor
Managed policy/Library/Application Support/ClaudeCode/CLAUDE.md on macOS, /etc/claude-code/CLAUDE.md on LinuxRules an organisation sets for everyone
User~/.claude/CLAUDE.mdYour preferences, in every project you open
Project./CLAUDE.md or ./.claude/CLAUDE.mdThe team's, committed with the code
Local./CLAUDE.local.mdYours, 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.mdAuto memory
Who writes itYouClaude
What is in itInstructions and rulesLearnings, preferences, corrections
When to use itStandards, commands, architectureThings 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.

Rules that fight
Contradictions are the main failure. If two files disagree, Claude may pick either one. When an instruction stops being followed, the first thing to check is whether something else in one of these files says the opposite.
Try it yourself
  • 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.