Glossaire Claude Code

Auto memory

Auto memory stores Claude's notes to itself across sessions in markdown files.

Aussi appelé : MEMORY.md, claude auto memory, /memory

Auto memory is the mechanism where Claude writes notes to itself across sessions, as opposed to CLAUDE.md which you write. It stores build commands, debugging insights, architecture notes, code style preferences and workflow habits. Claude decides what is worth remembering based on whether it would be useful in a future conversation, and does not save something every session.

Verified storage: ~/.claude/projects/<project>/memory/, containing a MEMORY.md entrypoint plus optional topic files. The <project> path is derived from the git repository, so all worktrees and subdirectories within the same repo share one auto memory directory; outside a git repo the project root is used. Auto memory is machine-local and is not shared across machines.

Loading rule: the first 200 lines of MEMORY.md, or the first 25KB, whichever comes first, are loaded at the start of every conversation — content beyond that is not loaded. MEMORY.md acts as an index; topic files like debugging.md are NOT loaded at startup and are read on demand. This 200-line/25KB limit applies only to MEMORY.mdCLAUDE.md files are loaded in full regardless of length. This relates to context-compaction as it limits what Claude can immediately recall.

Auto memory is on by default. You can toggle it in /memory by setting 'autoMemoryEnabled': false in settings, or by setting the environment variable CLAUDE_CODE_DISABLE_AUTO_MEMORY=1. You can change the storage location with 'autoMemoryDirectory'. The files are plain markdown you can read, edit, or delete, similar to how you manage your own notes in claude-md.

← Tous les termes du glossaire