Two mechanisms, two authors
You can pick a conversation back up with claude --continue (the latest) or claude --resume (choose from earlier ones). A new session, though, begins with an empty context window. What carries over is whatever gets loaded at the start, and the docs name two sources for that.
| Aspect | CLAUDE.md | Auto memory |
|---|---|---|
| Who writes it | You and your team | Claude Code itself |
| What goes in | Instructions, conventions, commands, architecture | What Claude learned while working: your preferences, corrections, project facts, pointers |
| Where it lives | Repo, home folder or a managed system path | ~/.claude/projects/<project>/memory/ |
| What loads | The whole file, every session | The first 200 lines or 25KB of MEMORY.md |
| Shared with the team | Yes, the project file through git | No, it stays on your machine |
| Default | You create it | On in local sessions |
CLAUDE.md: the memory you write
CLAUDE.md can sit in four places. Claude Code loads the files in the working directory and every directory above it at startup, joined from the root down. Files in subdirectories load when Claude works there.
- Managed policy: a system path set by IT, for example
/etc/claude-code/CLAUDE.mdon Linux or%ProgramFiles%\ClaudeCode\CLAUDE.mdon Windows. - User:
~/.claude/CLAUDE.md, your personal rules for every project. - Project:
./CLAUDE.mdor./.claude/CLAUDE.md, committed to git and shared with the team. - Local:
./CLAUDE.local.md, for personal project instructions; add it to.gitignoreyourself.
You can import other files with @path/to/file, up to four levels deep, and split topics into .claude/rules/*.md, optionally scoped with paths so a rule only loads for matching files. Keep each file under 200 lines.
Auto memory: the memory Claude writes
Auto memory is on by default. While you work, Claude Code saves notes of four kinds: user, feedback, project and reference. It skips what already follows from the code or from CLAUDE.md. Each note is its own file, and MEMORY.md is the index. At the next session start, the index loads and the notes are read when they matter.
You manage it with /memory. That command also holds the switch to turn it off, which writes autoMemoryEnabled to your settings. You can move the folder with autoMemoryDirectory.
The misunderstanding: memory is not enforcement
Both mechanisms are context. Claude reads them and usually follows them, but nothing forces it to. The docs say it plainly: to block an action, use a PreToolUse hook. If “never push to main” matters, a hook that exits with code 2 stops the push; a line in CLAUDE.md only asks. See Claude Code hooks.
The second misunderstanding is that auto memory follows you. It is machine-local. It is not shared between machines or cloud environments, so a session on claude.ai/code or a colleague’s laptop starts without it.
What this means for a team
What a team shares out of the box is instructions: the project CLAUDE.md, AGENTS.md and .claude/rules/ in git, and a managed CLAUDE.md from IT. They are only as good as the last person who edited them. Auto memory is where most of the learning happens, corrections and preferences picked up during real work, and that learning stays with one developer. When a teammate corrects Claude on the same thing a week later, their agent learns it again from zero. And when someone switches to Cursor, Copilot or ChatGPT for a task, none of it comes along. How to get the most out of what Claude Code does share is in how to share Claude Code context with your team.
Where Bombos fits
Bombos is a plugin that adds a shared memory under Claude Code and the other AI tools a team uses. What one developer’s agent learns, a rule the team agreed on, or a decision buried in mail or a repo, becomes available to every agent, with a trail showing what an answer rests on. It runs in the cloud or on your own server, and one developer can try it on their own agents first.
Related questions
Where is Claude Code's auto memory stored?
In ~/.claude/projects/<project>/memory/ on your own machine. MEMORY.md is the index, with one file per memory next to it. All worktrees of the same git repo share one folder.
How do I turn auto memory off?
Use the toggle in /memory, set autoMemoryEnabled to false in a project's settings, or set the environment variable CLAUDE_CODE_DISABLE_AUTO_MEMORY=1.
Does Claude Code read AGENTS.md?
By default, AGENTS.md loads when no CLAUDE.md or CLAUDE.local.md takes precedence. You can enable both formats in /config, or import it from CLAUDE.md with @AGENTS.md.
How long should CLAUDE.md be?
The docs advise under 200 lines per file. It loads into every session, so every line costs context and tokens. Split topics into .claude/rules/ files instead.
Is MEMORY.md loaded in full?
No. At session start Claude Code loads the first 200 lines or 25KB of MEMORY.md. The separate memory files are read when they are needed.
