[BUG] MEMORY.md is not loaded into system prompt — model has no instruction to check it
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
MEMORY.md files saved via the # memory shortcut are stored at ~/.claude/projects/<encoded-path>/memory/MEMORY.md, but this file is never loaded into the model's system prompt or context. The model receives CLAUDE.md files (global + project) but has zero awareness of MEMORY.md.
This means:
- The model cannot recall any memories saved via
#unless the user explicitly tells it to find and read the file - The model has no instruction in its system prompt to look for or check
MEMORY.md - When a user says "we talked about this" or "check your memory", the model has to search the filesystem blindly — it doesn't even know the path pattern (
~/.claude/projects/-<encoded-cwd>/memory/MEMORY.md)
Related issue: #23341 reports that memories go to MEMORY.md instead of CLAUDE.md. This issue is about the fact that even if MEMORY.md is the intended location, its contents are never injected into context.
What Should Happen?
Either:
- Load
MEMORY.mdinto the system prompt alongsideCLAUDE.mdfiles (preferred — this is the whole point of saving memories) - Or add an instruction in the system prompt telling the model about
MEMORY.mdand its path pattern, so it can proactively check it when relevant
Steps to Reproduce
- Open Claude Code in a project
- Save a memory:
# Always bump plugin versions in both marketplace.json and plugin.json - Verify it's saved to
~/.claude/projects/<encoded-path>/memory/MEMORY.md - Start a new conversation in the same project
- Ask the model "what do you know about version bumping?" — it has no idea
- Ask the model to inspect its system prompt —
MEMORY.mdis not mentioned anywhere
Error Messages/Logs
No error — the model simply has no awareness of MEMORY.md contents.
The system prompt only includes:
- Contents of ~/.claude/CLAUDE.md (user's private global instructions)
- Contents of <project>/CLAUDE.md (project instructions)
Claude Model
claude-opus-4-6
Is this a regression?
Not sure / Not applicable
Last Working Version
_No response_
Claude Code Version
2.1.38
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The MEMORY.md path uses an encoding pattern where / is replaced with - in the CWD path, e.g.:
- CWD:
/Users/foo/Projects/MyApp - Memory:
~/.claude/projects/-Users-foo-Projects-MyApp/memory/MEMORY.md
The model can discover this by globbing ~/.claude/projects/*/memory/MEMORY.md, but it has no instruction to do so.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗