[BUG] autoMemoryDirectory setting does not update the memory path in system prompt

Resolved 💬 5 comments Opened Mar 20, 2026 by boluoim Closed Mar 25, 2026

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

  1. Set "autoMemoryDirectory": ".claude/memory" in .claude/settings.json
  2. Create memory files at .claude/memory/MEMORY.md
  3. Start a new Claude Code session
  4. The system prompt # auto memory section still contains:

``
You have a persistent, file-based memory system at /Users/<user>/.claude/projects/-<encoded-path>/memory/
``

  1. 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

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗