Claude Code Memory is 📝Claude Code's file-based persistence layer at ~/.claude/projects/<project>/memory/, indexed by MEMORY.md, so durable facts survive across conversations and load automatically into future sessions.
Memory exists because Claude Code's per-session conversations would otherwise start blank — every user preference, correction, and project detail would have to be re-explained each time a new terminal opens. The persistence layer closes that gap by giving the agent a markdown-file store that ships into the system prompt at the start of every new conversation.
Memory is for practitioners who want Claude Code to retain user preferences, accepted corrections, ongoing project state, and pointers to external systems across sessions without manually re-onboarding the agent each time.
My setup uses the local memory directory as a hot cache and forwards every durable write into MythOS via the skill. Local memory wins on latency; MythOS wins on cross-device continuity and survives a laptop swap. Two layers, not a choice between them.
Key Capabilities
- File-based persistence — every memory is a plain markdown file under
~/.claude/projects/<project>/memory/; no database, no cloud sync, and no extra service to install or configure. - Indexed system prompt —
MEMORY.mdis a one-line-per-entry index that ships into every session's system prompt, capped near 150 lines so it stays under the context budget. - Categorized memory types — files typed by filename prefix:
user_*.mdfor preferences,feedback_*.mdfor corrections,project_*.mdfor initiatives,reference_*.mdfor external system pointers. - Slash-command and autonomous writes — the user invokes
/rememberto save a fact explicitly; Claude also writes autonomously when it detects a durable, non-obvious fact worth preserving. - On-demand reads — full memo files load automatically when their index descriptions match the live conversation, so only relevant context enters the working memory budget.
Getting Started
- Memory is built into Claude Code — no flag, no plan tier, no setup required.
- Use
/rememberto save a fact; Claude also writes durable facts autonomously. - Inspect or edit memories at
~/.claude/projects/<project>/memory/— plain markdown files. - Layer an external knowledge system on top for cross-device continuity if needed.
Related
- 📝MythOS Claude Code Skill — bridge that forwards every memory write into MythOS
- 📝MythOS — durable external store for cross-device continuity beyond the local laptop
- 📝CLAUDE.md as Infrastructure — layered instruction file that auto-loads with memory
