Auto-memory is on by default, ignores claude.ai memory settings, and is scoped per working directory so unrelated projects share one memory
Status Open
Reported on v2.1.259
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 0 comments · opened Sep 3, 2026
Summary
Claude Code's auto-memory (~/.claude/projects/<cwd-slug>/memory/) is enabled by default, is not governed by the two memory toggles in the claude.ai app ("Search and reference chats", "Generate memory from chats"), and is keyed by the working directory rather than by project. A user who launches claude from $HOME for several unrelated projects ends up with one shared memory directory, and the model then applies facts from one project to another. The user had both claude.ai memory toggles OFF on purpose and only discovered the local memory when the model referenced an unrelated project in a new session.
Environment
- Claude Code 2.1.259, Linux (x86_64), terminal CLI
~/.claude/settings.jsonhas noautoMemoryEnabledkey (default applies)- claude.ai account settings: both toggles under "Memory" turned OFF
What happened
- Over about three months, sessions for several unrelated projects were all started from
$HOME, so they all wrote to~/.claude/projects/-home-<user>/memory/(23 markdown files plusMEMORY.md). - A new session for project A received the whole
MEMORY.mdindex in its system prompt under the heading "user's auto-memory, persists across conversations", including entries about projects B, C and D. - The model used facts from project B (a business/legal context) when analysing project A, a personal project with no relation to B. The user had never connected the two.
- The user, seeing both claude.ai memory toggles OFF, assumed no cross-conversation memory was in use anywhere and reasonably read this as a privacy failure.
Expected
- One memory control, or at minimum a clear statement in the app's memory settings that Claude Code keeps a separate local auto-memory that these toggles do not affect.
- Memory scoped per project (git repository root, or an explicit project identifier), not per working directory. Launching from
$HOMEshould not create a single memory shared by every project on the machine. - A one-time, visible notice the first time auto-memory is created: where the files live, that they are injected into every future session started from that directory, and how to turn it off.
- Memory entries labelled with the project they came from, with the model instructed not to apply entries from other projects unless the user connects them.
Steps to reproduce
- Turn OFF both memory toggles in the claude.ai app settings.
- From
$HOME, runclaudeand work on project A for a while; let auto-memory write a few entries. Exit. - From
$HOME, runclaudeand start an unrelated task for project B. - Observe that
MEMORY.md(with project A entries) is injected into the system prompt and the model may reference project A facts.
Impact
- Privacy expectation mismatch: the user turned memory off in the only place the product surfaces it and still had cross-conversation memory active and transmitted with every session.
- Cross-project leakage of context (business, legal, personal projects mixed in one index).
- Quality: stale or unrelated memory degrades answers.
Workarounds found
/memory→ disable auto memory"autoMemoryEnabled": falsein~/.claude/settings.jsonCLAUDE_CODE_DISABLE_AUTO_MEMORY=1- Launch each project from its own directory so it gets its own memory directory
- Delete
~/.claude/projects/<cwd-slug>/memory/
None of these is discoverable from the app's memory settings, which is the root of the problem.
Related
- #23750 (option to disable auto-memory without disabling CLAUDE.md)