[BUG] Memory saved to undocumented MEMORY.md instead of CLAUDE.md
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
[BUG] Memory saved to undocumented MEMORY.md instead of CLAUDE.md
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
What's Wrong?
When using the # prefix to save memories, Claude Code saves them to an undocumented MEMORY.md file inside the internal project data directory instead of the documented CLAUDE.md locations.
Actual behavior: Memories are saved to:
~/.claude/projects/-Users-xxx-git-xx-xx/memory/MEMORY.md
Expected behavior: Memories should be saved to one of the documented locations (with a prompt to choose):
./CLAUDE.md(project memory)~/.claude/CLAUDE.md(user memory)./.claude/CLAUDE.md(project memory, alternative location)
Why This Is a Problem
- The
~/.claude/projects/<path>/memory/MEMORY.mdpath is not documented anywhere in the [memory documentation](https://code.claude.com/docs/en/memory). - This file is inside Claude Code's internal data directory, not in the project or user config — so it's not version-controlled, not visible to the user, and not portable.
- The
/memorycommand and documentation reference onlyCLAUDE.md/CLAUDE.local.mdfiles, creating confusion about where memories actually end up. - Users expect the
#shortcut to populateCLAUDE.mdfiles as documented.
Reproduction Steps
- Open Claude Code in a project directory
- Use
# <some memory text>to save a memory - Check where the memory was saved — it goes to
~/.claude/projects/<encoded-path>/memory/MEMORY.mdinstead of prompting forCLAUDE.mdlocation
Environment
- Claude Code version: [fill in — run
claude --version] - API: Anthropic API
- OS: macOS
- Terminal: [fill in]
What Should Happen?
It should use
User memory
Saved in ~/.claude/CLAUDE.md
Project memory
Checked in at ./CLAUDE.md
Error Messages/Logs
Steps to Reproduce
Claude response
Build successful. The fix was to pass data directly to open() instead of using input bindings.
The Problem with Input Bindings + Immediate Open
❯ Add this to CLAUDE.md
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.31
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
6 Comments
Must be something new from today.
I think it's probably indeed a bug that these instructions are enabled in production. There's nothing in the release notes about this.
It's not production ready:
Hi everyone, thanks for the feedback! I'm working on updates to the UI as well as getting our docs for auto-memory published. If you want to opt-out, you can disable auto-memory by setting the env var
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1I'm experiencing the opposite of this issue now —
MEMORY.mdwas working well for me (memories were being saved there and loaded into context), but as of v2.1.38, theMEMORY.mdcontents are no longer injected into the system prompt at all.I discovered this when I asked Claude to "check project memory" about plugin versioning rules I'd previously saved. It had no idea and had to search the filesystem to find the file.
I then directly interrogated the model about its system prompt:
I also verified:
CLAUDE_CODE_DISABLE_AUTO_MEMORYenv var is set~/.claude/settings.jsonMEMORY.mdfile exists at~/.claude/projects/<encoded-path>/memory/MEMORY.mdwith valid contentFiled a separate issue for this: #25318
So to summarize: the
MEMORY.mdlocation may be undocumented (your issue), but the bigger problem now is that even if you acceptMEMORY.mdas the storage location, its contents are not loaded into the model's context — making the entire memory feature silently broken.This is now documented here: https://code.claude.com/docs/en/memory#auto-memory
We're rolling auto-memory out slowly, but if you'd like to opt-in during the preview period, you can do so from
/memoryin Claude CodeThis issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.