MEMORY.md loaded twice: auto-memory and claudeMd loaders both inject same file
Resolved 💬 3 comments Opened Feb 7, 2026 by terry-li-hm Closed Feb 11, 2026
Bug
MEMORY.md in ~/.claude/projects/<hash>/memory/ is injected into the system prompt twice per session by two independent loading mechanisms:
- Auto-memory loader — injects it into a dedicated "auto memory" section near the top of the system prompt
- claudeMd / project-instructions loader — picks it up again as "user's private global instructions for all projects" inside the
claudeMdblock
Both resolve to the same physical file. The result is ~duplicate tokens wasted every API round-trip.
Reproduction
- Put content in
~/.claude/projects/<hash>/memory/MEMORY.md - Start a conversation
- Observe the system prompt contains the MEMORY.md content twice — once in the auto-memory section and once in the claudeMd section
Expected behaviour
The file should be loaded once. Either the auto-memory loader should skip files already claimed by claudeMd, or vice versa.
Workaround
None that preserves both features. Moving content to CLAUDE.md and emptying MEMORY.md works but conflates project instructions with session memory.
Impact
~3KB of duplicated tokens per API call. On a 20-turn conversation, that's ~60K tokens of pure waste — meaningful on usage-capped plans (Max20).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗