[BUG] autoMemoryDirectory setting does not update the memory path in system prompt
Description
When autoMemoryDirectory is set in project settings, the system prompt still instructs the model to use the default path (~/.claude/projects/<encoded-path>/memory/). This causes the model to read/write memory at the wrong location, ignoring the custom setting entirely.
Steps to reproduce
- Set
"autoMemoryDirectory": ".claude/memory"in.claude/settings.json - Create memory files at
.claude/memory/MEMORY.md - Start a new Claude Code session
- The system prompt
# auto memorysection still contains:
````
You have a persistent, file-based memory system at /Users/<user>/.claude/projects/-<encoded-path>/memory/
- Model reads/writes to the default path, not the configured
.claude/memory/
Expected behavior
The system prompt should reflect the configured autoMemoryDirectory path, e.g.:
You have a persistent, file-based memory system at <project-root>/.claude/memory/
Actual behavior
The system prompt always uses the default encoded path regardless of autoMemoryDirectory setting. The model follows the system prompt and operates on the wrong directory.
Workaround
Add an explicit override in project CLAUDE.md to force the model to use the correct path, since CLAUDE.md instructions take priority over the system prompt.
Environment
- Claude Code version: latest
- OS: macOS
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗