Every Claude Code session starts with a fresh context window. Left alone, Claude would be a goldfish.
Two things carry knowledge across sessions. CLAUDE.md files hold instructions you write, and Claude Code loads them into every session. Auto memory holds notes Claude writes itself, based on your corrections and preferences. Type /memory to check and clean both. A third drawer sits right next to them: skills, for the procedures Claude only needs sometimes.
Disclosure: Skillpack, the site you're reading, manages SKILL.md skill packages. It does not manage CLAUDE.md or auto memory. The facts here come from the Claude Code memory docs as they stood on November 30, 2026.
What does Claude Code remember between sessions?
Claude Code remembers your CLAUDE.md files and its own auto memory.
CLAUDE.md is the drawer you write. Where the file sits sets who it's for:
./CLAUDE.mdor./.claude/CLAUDE.mdis the project file. Your team shares it through source control.~/.claude/CLAUDE.mdholds your personal preferences for all projects../CLAUDE.local.mdis personal and project-specific. Add it to.gitignore.
Keep it short. The docs set a target of under 200 lines per file, because a longer file takes more context and Claude follows it less closely. Claude writes the other drawer.
Where does auto memory live?
Auto memory lives in a folder on your machine, at ~/.claude/projects/<project>/memory/. The <project> part comes from the git repo, so all worktrees and subdirectories of one repo share one memory directory.
Auto memory is machine-local. It doesn't travel to another machine or a cloud environment.
You'll clean this folder later, so learn its layout:
~/.claude/projects/<project>/memory/
├── MEMORY.md # Index, one line per memory, loaded at session start
├── user_role.md # One memory
├── feedback_testing.md # One memory
└── ... # Any other topic files Claude creates
MEMORY.md is the index, and Claude Code loads it at session start. The topic files wait their turn. Each holds one note, and Claude reads it on demand.
Which notes does Claude choose to save?
Claude saves four kinds of notes, and it's picky about all of them. Expect these in the folder:
- user: your role, expertise and preferences.
- feedback: corrections, plus approaches you confirm.
- project: ongoing work, deadlines and decisions Claude can't derive from the code or git.
- reference: where to find information outside the project, like an issue tracker or a dashboard.
Plenty gets skipped. Claude leaves out what it can derive from the codebase, such as file paths or debugging fixes. Anything your CLAUDE.md already says stays out too.
Some sessions end with nothing saved at all. Claude decides based on whether a note would be useful later. You get to check its choices.
Check and clean it in three steps
Type /memory and Claude Code lists your CLAUDE.md, CLAUDE.local.md and memory locations.
Memory files are plain markdown. Transcript cleanup skips them, so a file stays until you or Claude edits or deletes it. The cleanup is yours:
- Type
/memoryand pick the option that opens the auto memory folder. - Open
MEMORY.md, the index: one line per memory, each with its own topic file such asuser_role.md. - Stale memory? Delete its topic file and its line in
MEMORY.md. Wrong one? Fix the topic file.
Watch the size. Only the first 200 lines or 25KB of MEMORY.md load at session start, whichever comes first. Anything past the limit drops off on the next load. When the index nears the limit, Claude Code reminds Claude to keep it short: one line per entry, stale entries merged or dropped.
A message like "Saved 2 memories" or "Recalled 2 memories" tells you Claude is writing to the memory folder or reading from it.
"Remember this" or "add this to CLAUDE.md": you pick the drawer
Tell Claude what to save, and your wording picks the drawer. Say "remember that the API tests require a local Redis instance" and Claude saves it to auto memory.
Say "add this to CLAUDE.md", or edit the file through /memory, and the note lands in CLAUDE.md instead.
Some notes belong in CLAUDE.md, where they load every session. Among the signs the docs list:
- Claude makes the same mistake a second time.
- You type the same correction you typed last session.
- A new teammate would need the same context.
Those notes go in the file you write.
Turn auto memory off
Auto memory is on by default in local sessions, and the toggle in /memory stops Claude's note-taking. That toggle saves autoMemoryEnabled to ~/.claude/settings.json.
For one project only, put this in that project's settings:
{
"autoMemoryEnabled": false
}
Prefer an environment variable? Set CLAUDE_CODE_DISABLE_AUTO_MEMORY=1.
Left on, memory still can't do everything.
Is memory a rule Claude must obey?
No. Memory is context, not a rule Claude must obey. That holds for CLAUDE.md and auto memory alike. To block an action regardless, the docs point to a PreToolUse hook. One more limit applies to auto memory.
Do subagents get your memory?
Subagents don't get your main auto memory. The exception is a fork. A subagent can have its own memory through the subagent memory field. That leaves the third drawer.
Where do skills fit?
Skills hold what Claude only needs sometimes. The docs keep CLAUDE.md for facts Claude should hold every session. Then comes the eviction notice:
If an entry is a multi-step procedure or only matters for one part of the codebase, move it to a skill or a path-scoped rule instead.
Here are the three drawers side by side:
| Drawer | When it loads | What goes in |
|---|---|---|
| CLAUDE.md | Every session | Build commands, conventions, layout, "always do X" rules |
| Auto memory | MEMORY.md index at session start, topic files on demand | Your role and preferences, your corrections, project decisions |
| A skill | When you invoke it or when Claude determines it's relevant to your prompt | A multi-step procedure, or what only matters for one part of the codebase |
New to skills? Start with what a SKILL.md file is, then compare CLAUDE.md vs AGENTS.md vs SKILL.md.
Is Claude Code memory shared with my teammates?
Auto memory is machine-local, so teammates don't get it. A project CLAUDE.md at ./CLAUDE.md or ./.claude/CLAUDE.md is shared with the team through source control.
Next step
To see what Claude remembers about you, open a session and type /memory. Clear out one stale memory, then say "remember that" about one thing you're tired of repeating. Found a long procedure hiding in your CLAUDE.md? Move it to a skill, and steal ideas from the best Claude Code skills. Once a skill earns its place, save it in a Skillpack workspace.