Turn off Claude Code auto memory or move it: autoMemoryEnabled and autoMemoryDirectory

Claude Code Published:

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.

Verified on Sep 10, 2026 These tools change quickly. Please also check the latest official documentation.
Contents
  1. What auto memory is
  2. Turning it off
  3. Moving it
  4. Inspecting and deleting
  5. Summary

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.

typeContents
useryour role, expertise, and working preferences
feedbackcorrections you gave and approaches you confirmed
projectongoing work, deadlines, decisions not derivable from code or git history
referencewhere 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
}
MethodScopeNotes
the toggle in /memoryuser settingswrites autoMemoryEnabled to ~/.claude/settings.json
autoMemoryEnabled: falsethe settings file you put it inin a project's .claude/settings.json it affects that project only
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1one sessiontakes 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: false disables it; in a project's settings it affects that project only
  • CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 disables it for one session and outranks the setting
  • autoMemoryDirectory relocates it; project settings require workspace trust
  • Only the first 200 lines or 25KB of MEMORY.md load; 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.