How to Turn Off Auto Memory in Claude Code

How to Turn Off Auto Memory in Claude Code

To disable memory in Claude Code, open /memory in a session and switch the Auto-memory toggle to off. That saves "autoMemoryEnabled": false to your user settings, so auto memory stays off in every project. If you only want Claude Code to disable memory in one project, put "autoMemoryEnabled": false in that project’s .claude/settings.json instead.

For a single session, start Claude Code with the environment variable CLAUDE_CODE_DISABLE_AUTO_MEMORY=1. Turning auto memory off does not delete anything Claude already saved. Those notes live in ~/.claude/projects/<project>/memory/, and you remove them yourself.

We tried each switch in a real session below, watched the toggle change, and checked that Claude stopped recalling a note it had saved earlier.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.332 on macOS on December 1, 2026. We used a throwaway demo project called recipe-box with one tiny Python file and a fresh Git repository. We started Claude Code with project and local settings only and kept auto memory in a folder inside the demo, so our personal setup stayed out of the test.

We tested on macOS; the Windows and Linux steps follow Anthropic’s official instructions.

Quick Summary: Every Way to Disable Memory in Claude Code

MethodWhere it appliesHow long it lastsWe checked it
/memory toggleEvery project (user settings)Until you switch it backPanel only (see note below)
"autoMemoryEnabled": falseThe project or settings file you put it inUntil you remove itYes, in a real session
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1The session you start with itThat session onlyYes, in a real session
claude --bareScripted runsThat run onlyFrom the docs
Delete the memory filesOne project’s saved notesPermanentYes, in the demo folder

What Auto Memory Is and Why You Might Turn It Off

Auto memory is a set of notes Claude Code writes for itself. When you correct it, say “remember that…”, or share a preference, Claude may save a short markdown file so a future session knows it too. Anthropic’s memory documentation lists four kinds of notes: user, feedback, project and reference.

It is on by default in local sessions. At the start of each session, the first 200 lines or 25KB of the MEMORY.md index load into Claude’s context, and Claude opens the detailed topic files only when it needs them.

That is handy for many people, but there are good reasons to switch it off:

  • You want every session to start clean, with only your CLAUDE.md rules and nothing Claude picked up on its own.
  • You share a demo, a workshop or a recording and don’t want past notes showing up.
  • You keep all instructions in a reviewed CLAUDE.md file and don’t want a second, unreviewed source.
  • You work on sensitive projects and prefer that no extra notes are written to disk.
  • You are debugging odd behavior and want to rule memory out.

If you want the full picture of how the system works first, read our guide to how the memory system works. This post focuses only on switching it off and cleaning up.

What We Tested: Memory On, Then Off Three Ways

We first left auto memory on and asked Claude to remember one simple rule. Then we turned memory off in different ways and checked what Claude could still see.

Step 1: Check the toggle in /memory

Type /memory and press Enter. The first line of the panel shows Auto-memory with its current state. With memory on, you also get an “Open auto-memory folder” entry.

Claude Code /memory panel showing Auto-memory on and the Open auto-memory folder option
The /memory panel in our demo: Auto-memory is on, and the folder option is listed.

Step 2: Let Claude save a note

We typed one short prompt: “Remember for future sessions: this project always uses tabs for indentation, never spaces.” Claude replied that it saved the note to a topic file and added it to the MEMORY.md index.

Claude Code reply confirming it saved a memory about tabs for indentation
With memory on, Claude wrote the rule to auto memory. One tool step failed along the way, but the save went through.

Here is what landed on disk. Our demo stored memory in a local folder through the autoMemoryDirectory setting, so you can see the exact files without touching a real setup.

Terminal listing MEMORY.md and use-tabs-for-indentation.md plus the one-line index entry
Two files: the MEMORY.md index and one topic file for the saved rule.

Step 3: Turn it off for one project

Next we created .claude/settings.json in the project with one line, "autoMemoryEnabled": false, and started a new session. The /memory panel now read Auto-memory off, and the folder option was gone.

Project settings.json with autoMemoryEnabled false and the /memory panel showing Auto-memory off
The project setting switched auto memory off for this project.

Then we asked, “Do we use tabs or spaces for indentation in this project?” and told Claude not to read files. It said it could not tell. The note was still on disk, but Claude no longer loaded it.

Claude Code answering that it cannot say whether the project uses tabs or spaces
Memory off: the saved tabs rule no longer reached Claude.

Step 4: Turn it off for one session

We emptied the project setting and started Claude with CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 claude. The panel showed Auto-memory off again, with no settings file involved.

Claude Code /memory panel showing Auto-memory off when started with CLAUDE_CODE_DISABLE_AUTO_MEMORY=1
Started with CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 and an empty settings file: memory is off.

Step 5: See the override in action

The variable works both ways. We put "autoMemoryEnabled": false back and started with CLAUDE_CODE_DISABLE_AUTO_MEMORY=0. The panel showed on, because the docs say the variable takes precedence over the setting for one session.

Settings file says autoMemoryEnabled false but /memory shows Auto-memory on because the env variable is 0
The setting says false, but CLAUDE_CODE_DISABLE_AUTO_MEMORY=0 forced memory on for this session.

How to Disable Memory in Claude Code: Every Method

Method 1: The /memory toggle (all projects)

  1. Start Claude Code with claude.
  2. Type /memory and press Enter.
  3. Highlight the Auto-memory line at the top and press Enter to switch it to off.
  4. Press Esc to close the panel.

The docs say this saves autoMemoryEnabled to your user settings at ~/.claude/settings.json. We only opened the panel and did not flip this toggle, because it writes to the real user settings file and we keep that file untouched in tests.

Claude Code docs explaining that the /memory toggle saves autoMemoryEnabled to user settings
Anthropic’s docs: the toggle writes autoMemoryEnabled to ~/.claude/settings.json.

One catch from the docs: the toggle can turn memory off, but it can’t turn it back on inside a background session or a session that another Claude Code session started. There it reads “off” with a note to use a session started outside Claude Code. Run claude straight from your terminal and toggle it there.

Method 2: The autoMemoryEnabled setting (one project or everywhere)

Add this to a settings file:

{
  "autoMemoryEnabled": false
}

Where you put it decides the reach:

  • .claude/settings.json in a project: off for everyone who uses that project, and you can commit it.
  • .claude/settings.local.json in a project: off for just you in that project.
  • ~/.claude/settings.json: off for you in every project (the same thing the toggle does).

If two files disagree, the higher layer wins: managed settings, then --settings on the command line, then local project, then shared project, then user. Our guide on finding settings.json shows each file’s path on Mac, Windows and Linux, and you can copy more ready-made settings examples.

Claude Code settings reference entry for autoMemoryEnabled showing scope, type, default and overrides
The settings reference: autoMemoryEnabled works in any settings file and defaults to true.

Method 3: The environment variable (one session)

Set CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 before you start Claude Code. On macOS or Linux:

CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 claude

In Windows PowerShell, set it first and then start Claude:

$env:CLAUDE_CODE_DISABLE_AUTO_MEMORY = "1"
claude

According to the environment variables reference, when it is disabled Claude does not create or load auto memory files. Setting it to 0 forces memory on, even when --bare or a false setting would turn it off. Our list of environment variables covers how to set variables for good in your shell profile.

Method 4: Bare mode and safe mode

Two launch flags also skip auto memory. claude --bare is a minimal mode for scripts that skips hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md, as the CLI reference explains. It suits claude -p runs in headless mode.

claude --safe-mode turns off all customizations, auto memory included, for troubleshooting a broken setup. Use these for one-off runs, not as your everyday off switch.

Where Auto Memory Files Live and How to Delete Them

Switching auto memory off stops Claude from reading and writing notes. It does not erase them. If you want the notes gone, delete the files.

By default each project has its own folder at ~/.claude/projects/<project>/memory/. The <project> part comes from the Git repository, so all worktrees and subfolders of one repo share one folder. If you set autoMemoryDirectory, the files are in that folder instead.

The easiest way to find the folder is from inside Claude Code: run /memory and pick “Open auto-memory folder”. That entry only shows while memory is on, so do this before you switch it off. Then delete the files you don’t want:

# inside the memory folder of one project
ls
rm MEMORY.md use-tabs-for-indentation.md
Terminal listing two memory files and then an empty memory folder after deleting them
Our demo folder before and after we deleted the two memory files.

Claude Code’s cleanup of old session transcripts skips memory files, so they stay until you or Claude delete them.

Deleting only some topic files is fine too, as long as you also remove their lines from MEMORY.md. To clear old chats as well, see how to delete session history.

Which Claude Code Memory Off Switch Should You Use?

Pick the narrowest switch that does the job. This ladder walks you through it.

Decision ladder: off everywhere uses the /memory toggle, one project uses the settings file, one session uses the environment variable
Start at the top: everywhere, one project, or one session.

And when switches disagree, this is the order that wins for a session.

Priority stack: environment variable on top, then bare mode, then the autoMemoryEnabled setting, then the default
The environment variable outranks everything below it, in either direction.

Turning auto memory off hides your notes from Claude. Deleting the files is what removes them.

Try It Yourself

Make a throwaway folder, start Claude Code there, and run this prompt. Then add the project setting and ask again in a new session.

Remember for future sessions: in this folder, every file name uses lowercase letters with dashes.

Next, create .claude/settings.json with "autoMemoryEnabled": false, start a fresh session, and ask “What naming rule do we use here? Don’t read any files.” Claude should not know. Remove the setting and ask once more to see the note come back.

Common Mistakes

  • Thinking the toggle deletes your notes. It only stops loading and saving them; the files stay on disk.
  • Putting the setting in the wrong file. A settings.local.json change won’t affect teammates, and a user setting can be overridden by a project file.
  • Setting the variable after Claude Code has started. It is read at launch, so restart the session.
  • Forgetting a CLAUDE_CODE_DISABLE_AUTO_MEMORY=0 in your shell profile, which forces memory on no matter what your settings say.
  • Expecting CLAUDE.md to stop loading. Turning off auto memory leaves your CLAUDE.md files alone; see every CLAUDE.md location if you want to control those.
  • Deleting a topic file but leaving its line in MEMORY.md, so the index points at a file that no longer exists.

Pro Tips

  • Check the state any time with /memory; the first line tells you on or off for the current session.
  • Before you switch memory off, open the folder from /memory and read what Claude saved. You might want to move a good note into CLAUDE.md.
  • Commit "autoMemoryEnabled": false in a shared repo if your team agrees every session should start the same way.
  • Use autoMemoryDirectory if your problem is where notes are stored rather than whether they exist.
  • If Claude behaves strangely, a quick CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 claude run tells you whether a stale note is the cause. For other odd messages, check our list of common errors.

Cheat Sheet

Cheat sheet listing the /memory toggle, autoMemoryEnabled, CLAUDE_CODE_DISABLE_AUTO_MEMORY, claude --bare and the memory folder path
Every switch for auto memory on one card.

Frequently Asked Questions

Does turning off auto memory delete what Claude saved?

No. Claude stops reading and writing the memory folder, but the files stay. Delete them from ~/.claude/projects/<project>/memory/ if you want them gone.

Is auto memory on by default?

Yes, in local sessions. The docs note that sessions in a self-hosted environment start with it off, outside Claude Tag sessions.

Will disabling auto memory stop CLAUDE.md from loading?

No. CLAUDE.md files are separate and keep loading. A different variable, CLAUDE_CODE_DISABLE_CLAUDE_MDS=1, stops all of them, auto memory included.

Why can’t I turn auto memory back on from /memory?

In a background session, or one another Claude Code session started, the toggle can only switch memory off. Run claude directly in your terminal and use the toggle there.

Is auto memory shared with my team or other computers?

No. Auto memory is machine-local and is not shared across machines or cloud environments. Only files you commit, like a project CLAUDE.md, reach teammates.

Conclusion

To disable memory in Claude Code, use the /memory toggle for every project, "autoMemoryEnabled": false in a project’s settings for one repo, or CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 for a single session, and remember the variable beats the setting in either direction. In our test each switch flipped the panel to off and Claude stopped recalling a saved rule, while the files stayed on disk until we deleted them. Check what Claude saved, keep the good notes in CLAUDE.md, and pick the narrowest switch that fits. For more on the Claude assistant itself, see our Claude AI overview.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top