claude-code - 💡(How to fix) Fix autoMemoryDirectory setting not respected by auto-memory system

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The autoMemoryDirectory setting in .claude/settings.local.json does not appear to be respected. Claude Code continues to write memories to the default ~/.claude/projects/<project>/memory/ path instead of the configured directory.

Root Cause

The autoMemoryDirectory setting in .claude/settings.local.json does not appear to be respected. Claude Code continues to write memories to the default ~/.claude/projects/<project>/memory/ path instead of the configured directory.

Fix Action

Workaround

Added a note in CLAUDE.md pointing to the correct directory, and locked the default directory with chmod 000 to prevent writes. The CLAUDE.md note alone was not sufficient — Claude still defaulted to the hardcoded path until manually corrected.

Code Example

{
     "autoMemoryDirectory": "/path/to/repo/knowledge/memory"
   }
RAW_BUFFERClick to expand / collapse

Description

The autoMemoryDirectory setting in .claude/settings.local.json does not appear to be respected. Claude Code continues to write memories to the default ~/.claude/projects/<project>/memory/ path instead of the configured directory.

Steps to reproduce

  1. Set autoMemoryDirectory in .claude/settings.local.json:
    {
      "autoMemoryDirectory": "/path/to/repo/knowledge/memory"
    }
  2. In a conversation, trigger a memory save (e.g., user asks Claude to remember something)
  3. Claude writes the memory to ~/.claude/projects/<project>/memory/ instead of the configured path

Expected behavior

Memories should be written to the path specified by autoMemoryDirectory.

Actual behavior

The system prompt hardcodes the default ~/.claude/projects/<project>/memory/ path, and autoMemoryDirectory does not override it. Claude follows the hardcoded path in its instructions.

Workaround

Added a note in CLAUDE.md pointing to the correct directory, and locked the default directory with chmod 000 to prevent writes. The CLAUDE.md note alone was not sufficient — Claude still defaulted to the hardcoded path until manually corrected.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Memories should be written to the path specified by autoMemoryDirectory.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING