Diagram

Where Claude Code memory comes from

Three sources feed a Claude Code session. CLAUDE.md files you write and the auto memory index Claude writes load at session start. An MCP memory server such as XERJ is read only when the agent calls it. CLAUDE.md files You write them Load every session Auto memory Claude writes it MEMORY.md loads at start Session context what the model sees MCP memory server e.g. XERJ Read only when called
The two built-in systems load on their own. A memory server adds search over more than fits in context, and only costs tokens when the agent asks. Based on the Claude Code memory docs, checked 2026-10-30.