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

Memory

Memory is the set of instruction files that Claude Code loads into context, from four CLAUDE.md scopes you write to an auto memory file it writes for itself.

Last updated: 29 Sep, 2026 · Claude Code

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.

Where CLAUDE.md files can live · from the Complete Claude Code Course In 2 Hours For Developers · 42:10 to 43:49

The video names three places for the file. A CLAUDE.md in the project is committed, so the whole team gets the same context. A CLAUDE.local.md in the project holds your own notes for it and is never committed. A CLAUDE.md in the .claude folder of your home directory (on the video's Windows machine, under C:\Users\<you>\.claude) applies to every project on the machine.

The docs add a fourth scope, for organisations, and fix the order they load in.

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.
PreviousCLAUDE.md

Little by little, you're building something great.