Skip to content

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

Description

@boluoim

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/
    
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existsmemoryplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions