
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
| Method | Where it applies | How long it lasts | We checked it |
|---|---|---|---|
/memory toggle | Every project (user settings) | Until you switch it back | Panel only (see note below) |
"autoMemoryEnabled": false | The project or settings file you put it in | Until you remove it | Yes, in a real session |
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 | The session you start with it | That session only | Yes, in a real session |
claude --bare | Scripted runs | That run only | From the docs |
| Delete the memory files | One project’s saved notes | Permanent | Yes, 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.mdrules 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.

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.

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.

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.

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.

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.

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.

How to Disable Memory in Claude Code: Every Method
Method 1: The /memory toggle (all projects)
- Start Claude Code with
claude. - Type
/memoryand press Enter. - Highlight the Auto-memory line at the top and press Enter to switch it to off.
- 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.

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.jsonin a project: off for everyone who uses that project, and you can commit it..claude/settings.local.jsonin 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.

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 claudeIn Windows PowerShell, set it first and then start Claude:
$env:CLAUDE_CODE_DISABLE_AUTO_MEMORY = "1"
claudeAccording 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
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.

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

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.jsonchange 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=0in your shell profile, which forces memory on no matter what your settings say. - Expecting
CLAUDE.mdto stop loading. Turning off auto memory leaves yourCLAUDE.mdfiles 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
/memoryand read what Claude saved. You might want to move a good note intoCLAUDE.md. - Commit
"autoMemoryEnabled": falsein a shared repo if your team agrees every session should start the same way. - Use
autoMemoryDirectoryif your problem is where notes are stored rather than whether they exist. - If Claude behaves strangely, a quick
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 clauderun tells you whether a stale note is the cause. For other odd messages, check our list of common errors.
Cheat Sheet

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.


