claude-code - 💡(How to fix) Fix [BUG] autoMemoryDirectory ignored when set to a relative path

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…

Fix Action

Fix / Workaround

Workaround: use an absolute path for autoMemoryDirectory.

Code Example

{
    "autoMemoryEnabled": true,
    "autoMemoryDirectory": "./.claude/memory"
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Reopening #33535, which was auto-closed as stale despite still being reproducible.

The autoMemoryDirectory setting introduced in v2.1.74 is ignored when set to a relative path. As I commented on the original issue:

Same issue here.

It seems full paths work, but relative paths don't.

When autoMemoryDirectory is set to a relative path like ./.claude/memory, auto-memory still writes to the default ~/.claude/projects/<slug>/memory/ location. Setting it to an absolute path appears to work as expected.

What Should Happen?

Relative paths in autoMemoryDirectory should be resolved (likely against the project root / current working directory) and honored, just like absolute paths are.

Steps to Reproduce

In project .claude/settings.json:

{
    "autoMemoryEnabled": true,
    "autoMemoryDirectory": "./.claude/memory"
}

Start Claude Code and send a message such as "Remember: if you want me to debug something manually, add pdb breakpoint()'s".

Observe that the Write tool is invoked against ~/.claude/projects/<slug>/memory/ instead of ./.claude/memory.

Workaround: use an absolute path for autoMemoryDirectory.

Is this a regression?

Yes, per the original report this worked in a previous version.

Platform

macOS

Additional Information

Original (auto-closed) issue: https://github.com/anthropics/claude-code/issues/33535

extent analysis

TL;DR

The issue can be worked around by using an absolute path for the autoMemoryDirectory setting instead of a relative path.

Guidance

  • Verify that the issue is indeed due to the use of a relative path by trying an absolute path as suggested in the workaround.
  • Check the project's root directory and current working directory to ensure they are as expected, which might influence how relative paths are resolved.
  • Consider adjusting the project's configuration to use an absolute path for autoMemoryDirectory as a temporary solution until the relative path issue is resolved.
  • Review the original issue (#33535) and its comments for any additional insights or potential fixes that might have been discussed.

Example

No code snippet is provided as the issue is more about configuration and path resolution rather than code implementation.

Notes

The exact reason for the regression and why relative paths are not being honored as expected is not specified, suggesting a potential bug in the path resolution logic of Claude Code.

Recommendation

Apply workaround: Use an absolute path for autoMemoryDirectory as it is confirmed to work as expected, allowing for continued use of the feature until a fix for relative paths is implemented.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING