Claude/Code/Q/What is the MEMORY.md feature in Claude Code, can I customize where these files are stored, and is it based on an open spec like AGENTS.md?
Properties
- logseq-entity
- Logseq/Entity/Question
What is the MEMORY.md feature in Claude/Code, can I customize where these files are stored, and is it based on an open spec like AGENTS.md?
AI Answer
- AI/Response
- Short answer: MEMORY.md is the index file for Claude Code's auto-memory system (v2.1.59+), stored by default at
~/.claude/projects/<project>/memory/. The location can be customized viaautoMemoryDirectoryin user settings. It is not based on an open spec — it is Anthropic-proprietary; AGENTS.md is an OpenAI/Codex convention for agent instructions, which Claude Code does not natively read. - What MEMORY.md is:
- Auto memory lets Claude accumulate knowledge across sessions without manual effort — build commands, debugging insights, architecture notes, code style preferences, workflow habits
- The memory directory holds
MEMORY.mdas a concise index plus optional topic files (e.g.debugging.md,api-conventions.md) - Only the first 200 lines (or 25 KB) of
MEMORY.mdare injected into context at session start; topic files are read on demand via file tools - Claude decides what is worth saving — it does not write to memory every session
- Memory is machine-local and shared across all worktrees of the same git repository
- Default storage location:
- Customizing the storage location:
- Toggle and inspect auto memory:
- Is it based on AGENTS.md or any open spec?
- No. MEMORY.md is proprietary to Claude Code's auto-memory system; there is no public specification
- AGENTS.md is a convention from OpenAI/Codex for persistent agent instructions — a different concept (human-written rules, not agent-written notes)
- Claude Code reads
CLAUDE.mdfor instructions, notAGENTS.md; you can bridge both with@AGENTS.mdinsideCLAUDE.mdso both tools share the same rules without duplication - No cross-agent open spec exists that covers MEMORY.md-style auto-written memory files
- Sources: How Claude remembers your project — Claude Code Docs