Originally published at claudeguide.io/claude-code-memory-system
Claude Code Memory: Auto-Memory vs CLAUDE.md Explained
Claude Code uses two distinct memory layers: a 200K-token conversation context that resets when a session ends, and persistent CLAUDE.md files that auto-load at every session start in 2026. Understanding the difference determines whether your project context survives between sessions — or disappears the moment you close the terminal. For real-world CLAUDE.md examples, see How to Write Effective CLAUDE.md Files.
The Two Memory Types
Conversation Memory (Ephemeral)
Everything Claude learns during a session — the shape of your codebase, coding preferences you mentioned, debugging context — lives in the active context window. When you type /exit or close the terminal, that memory is gone. The next session starts fresh.
This ephemeral layer is powerful for within-session work. Claude can hold up to 200K tokens of context, enough to reason across large codebases. But it does not persist.
CLAUDE.md (Persistent)
CLAUDE.md files are Markdown documents that Claude Code reads automatically when a session starts. They inject persistent context into every conversation — before you type your first prompt. Think of them as a briefing document Claude always reads before getting to work.
Claude Code looks for CLAUDE.md in several locations, in order of precedence:
-
~/.claude/CLAUDE.md— global user preferences applied to all projects - `<project-root
300 production-ready prompts covering memory management, CLAUDE.md templates, and session workflows — everything you need to get consistent results from Claude Code across projects.
Top comments (0)