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 memory section 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
Description
When
autoMemoryDirectoryis 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
"autoMemoryDirectory": ".claude/memory"in.claude/settings.json.claude/memory/MEMORY.md# auto memorysection still contains:.claude/memory/Expected behavior
The system prompt should reflect the configured
autoMemoryDirectorypath, e.g.:Actual behavior
The system prompt always uses the default encoded path regardless of
autoMemoryDirectorysetting. The model follows the system prompt and operates on the wrong directory.Workaround
Add an explicit override in project
CLAUDE.mdto force the model to use the correct path, since CLAUDE.md instructions take priority over the system prompt.Environment