Turn off Claude Code auto memory or move it: autoMemoryEnabled and autoMemoryDirectory
What Claude Code's auto memory records and where, how to disable it with autoMemoryEnabled or CLAUDE_CODE_DISABLE_AUTO_MEMORY, how to relocate it, and the MEMORY.md load limit.
Alongside the CLAUDE.md you write, Claude Code keeps auto memory: notes Claude writes for itself about corrections you gave, your preferences, and project context it cannot derive from the code. It is useful, but on shared machines or throwaway environments people often want Claude to stop remembering things, or want the storage location under their control.
In short: autoMemoryEnabled: false turns it off, autoMemoryDirectory moves it, and CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 turns it off for a single session.
KEY POINT
What you will learn
- What auto memory records, where, and how much of it loads
- The three ways to disable or relocate it, and which one wins
- How to inspect and delete what has been saved
What auto memory is
Auto memory is Claude's own record of things it judged worth remembering. According to the docs it saves four kinds of notes, marked by a type field in each file's frontmatter.
| type | Contents |
|---|---|
user | your role, expertise, and working preferences |
feedback | corrections you gave and approaches you confirmed |
project | ongoing work, deadlines, decisions not derivable from code or git history |
reference | where to find information outside the project, such as an issue tracker |
Claude skips anything it can derive from the codebase and anything your CLAUDE.md already says. The default location is ~/.claude/projects/<project>/memory/, holding a MEMORY.md index plus one topic file per memory. Because <project> is derived from the git repository, all worktrees and subdirectories of one repo share a single memory directory.
用語解説
MEMORY.md: the index file. The first 200 lines or 25KB, whichever comes first, load at the start of every session; anything beyond that is not loaded. Topic files are not loaded at startup; Claude reads them on demand.
Turning it off
There are three ways, with different scope.
{
"autoMemoryEnabled": false
}
| Method | Scope | Notes |
|---|---|---|
the toggle in /memory | user settings | writes autoMemoryEnabled to ~/.claude/settings.json |
autoMemoryEnabled: false | the settings file you put it in | in a project's .claude/settings.json it affects that project only |
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 | one session | takes precedence over the setting |
When autoMemoryEnabled is false, Claude neither reads from nor writes to the memory directory. Even at the default true, something that outranks the key, such as --bare, safe mode, or the CLAUDE_CODE_DISABLE_AUTO_MEMORY variable, turns it off for that session.
Moving it
Set autoMemoryDirectory to an absolute path or a ~/-prefixed path to use that directory instead of the default. Any settings scope accepts it.
{
"autoMemoryDirectory": "~/my-memory-dir"
}
From project or local settings, Claude Code honors the key under the same workspace trust rule as hooks in settings files, because a cloned repository could supply it. In a folder you have not trusted, it does not apply.
It does not follow you to other machines
Auto memory is machine-local. It is not shared across machines or cloud environments. Knowledge the whole team needs belongs in CLAUDE.md, not auto memory. Asking Claude to "add this to CLAUDE.md" writes it there instead of to memory.
Inspecting and deleting
Run /memory in a session. Next to the CLAUDE.md list you get the auto memory toggle and an option to open the memory folder. The contents are plain Markdown, so edit or delete files directly.
The retention sweep driven by cleanupPeriodDays does not delete memory files; Claude Code removes the memory directory only if it stayed empty for the whole retention period. For the broader picture of what lives in context and how to keep it small, see Managing context in Claude Code, and for what to put in CLAUDE.md instead, How to write CLAUDE.md.
Summary
- Auto memory is Claude's own record, stored by default under
~/.claude/projects/<project>/memory/ autoMemoryEnabled: falsedisables it; in a project's settings it affects that project onlyCLAUDE_CODE_DISABLE_AUTO_MEMORY=1disables it for one session and outranks the settingautoMemoryDirectoryrelocates it; project settings require workspace trust- Only the first 200 lines or 25KB of
MEMORY.mdload; inspect and edit via/memory
FAQ
- Where is auto memory stored?
- By default in ~/.claude/projects/<project>/memory/. The project is derived from the git repository, so worktrees and subdirectories of the same repo share one directory.
- Can I turn auto memory off for one project only?
- Yes. Set autoMemoryEnabled: false in that project's .claude/settings.json.
- Does disabling auto memory stop CLAUDE.md from loading?
- No. CLAUDE.md is a separate mechanism and is unaffected by autoMemoryEnabled.
Primary sources
This article was drafted by AI from official documentation and reviewed by the site operator before publishing. Found a mistake? Let us know via the contact page.