Memory here means notes the harness saves from your sessions and brings back in later ones. Instruction files you write yourself, such as AGENTS.md or CLAUDE.md, are on the Instructions page.
Built-in memory
| Question | Claude CodeOn by default, checked at 2.1.299 |
|---|---|
| Is it on, and how do I switch it? | Auto memory is on by default in local sessions. Toggle it in a session with
Sessions in a self-hosted environment have auto memory off by default. From a background session, or a |
| Who writes memories, and when | Claude itself writes memories during the session, when it judges something will be useful later: your role and preferences ( Each memory file's frontmatter records its kind in a |
| Where they are kept | Memories live in An With Memory files are excluded from the |
| What a new session loads | At the start of every session Claude Code loads the first 200 lines or first 25KB of When a write leaves MEMORY.md near or over the limit, Claude Code tells Claude to compact the index (one line per entry, details in topic files). Recalled memories come with a note on how old they are. |
| See and edit them | Run |
| Make it remember something | Ask in plain language, e.g. "remember that the API tests require a local Redis instance" or "always use pnpm, not npm", and Claude saves it to auto memory. To make it a standing instruction instead, say "add this to CLAUDE.md" or edit CLAUDE.md via |
| Correct or forget something | Edit or delete the markdown files (and their line in |
| Share with a team or another machine | Partly The main auto memory is machine-local: it is shared across worktrees of one repo but not across machines or cloud environments, and it lives outside the repo. To share, put the facts in a checked-in CLAUDE.md, or point Remote sessions can also recall from mounted team memory stores ( |
| Memory for subagents | Yes. Add
|
Notes and sources
Claude Code, 9 sources
- Directory configuration does not establish a cross-harness import or merge protocol.
- Topic frontmatter observed in a local store is not a documented parser contract.
- 2.1.311 publisher fixes stale MEMORY.md immediately after automatic compaction when edited earlier in the session; no new memory loading budget is established.