Blog

How to disable Claude Code auto memory in one project

Markdown

Claude Code auto memory in a single project is turned off with the line autoMemoryEnabled: false in .claude/settings.json. How is this better than /memory, and how do you clean up notes?

Read full article

To turn off Claude Code auto memory for just one project, add "autoMemoryEnabled": false to that project's .claude/settings.json file. The toggle in the /memory command is not suitable for this: it writes the setting to your global file and turns off memory for every project on your computer.

An agent can quickly become cluttered with things it does not need. In the case described here, Hermes spent 2 hours thinking about a task. When asked, “How many tokens did you use?” it replied, “My rough estimate is 100 million.” Did you solve the task? “No, I researched it.” It kept going through all the files in turn and getting confused.

That is why you should put only the most valuable information into an agent's memory. And in the assessment given here, Claude Code auto memory is fairly weak: very small and heavily compressed. If you want Claude to work only by your rules, 1 line in the project settings is enough.

Let's look at how auto memory differs from CLAUDE.md, how to turn it off, and what to do with old notes. Let's go.

Ailoot reference documentation: ailoot.ai/docs/.

Key takeaway

Open the project's .claude/settings.json file and add "autoMemoryEnabled": false. If other people work on the project and you want to turn memory off only for yourself, put the same key in .claude/settings.local.json. The key applies only to this project; memory will keep working in the others. The toggle in /memory writes the key to ~/.claude/settings.json and turns memory off everywhere. Old notes stay on disk when memory is disabled. You can open them through /memory and clean them up manually.

How does auto memory differ from CLAUDE.md?

CLAUDE.md is the main instructions file, and you write it yourself. In every new chat, Claude is effectively asking, “What is here? Who am I? What should I do?” When everything is spelled out in CLAUDE.md, it says, “Right, I'm the expert. Got it.”

Claude writes auto memory itself. You tell it, “Remember that you should always reply in my preferred language,” or, “Don't hard-code values; always get them from the database,” and it writes a file in the memory folder, along the lines of “don't do that again.” In later sessions, it recalls this.

Of course, not always. Agents still forget things, and you have to keep an eye on them: “Listen, buddy, you've forgotten again. We've already been through this.” It replies, “Oh, yes, I remember; I found it here in the file.” That is why we generally put everything important in CLAUDE.md rather than relying on memory.

There is a detailed explanation of which rules to put in CLAUDE.md in a separate article, and how Memory in Claude chat differs from CLAUDE.md in another.

If you build your projects with AI agents, keep the documentation for the tools you use close at hand.

What Claude writes on its own

Claude Code saves 4 types of notes:

  • user — your role, experience, and preferred way of working;
  • feedback — your corrections and approaches you have confirmed;
  • project — current work, deadlines, and decisions that are not visible in the code;
  • reference — where to find information outside the project, such as a task tracker.

All of this lives in ~/.claude/projects/<project>/memory/. The main file there is MEMORY.md, a table of contents with 1 line per note. At the start of each session, Claude reads the first 200 lines or 25 KB from it and opens the other files when it needs them. Memory lives only on your computer: it does not move to another machine or to the cloud.

In the example described here, it contains the user's name and role, plus a rule against hard-coding dynamic values, just 5–7 lines in total. These are rules for the agent itself: how it should work.

You can store project knowledge in a second brain: folders of files that the agent reads through links. For this approach, it helps to define a “second brain” skill and keep a PDF with Hermes installation commands and a table of “which model to use for which task” alongside the project files.

How to turn off auto memory for one project

  1. Add the line to the project settings

    The project's main folder contains a hidden .claude folder with a settings.json file in it. The easiest approach is to ask Claude Code itself: “Add "autoMemoryEnabled": false to this project's .claude/settings.json file, and leave the other settings alone.” If you are opening it manually and the file does not exist, create it with this content:

    {
      "autoMemoryEnabled": false
    }
    

    If the file already contains settings, add the key alongside them and leave the rest alone. When autoMemoryEnabled is false, Claude neither reads the memory folder nor writes anything to it.

  2. Choose who the setting applies to

    .claude/settings.json is the shared project file, and it applies to everyone working on the project. If you want to turn memory off only for yourself, put the same key in .claude/settings.local.json: this is your personal settings file for this project.

    Project settings take precedence over your global settings. Even if memory is enabled in ~/.claude/settings.json, false wins for this project.

  3. Restart Claude Code

    Close the session and run claude again in the project folder. Type /status: your project file should appear in the Setting sources line. If it is there, Claude has read it. Memory will remain enabled in the neighboring project.

There are 2 other methods, but they serve different purposes:

  • The CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 environment variable. Running CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 claude disables memory only for that run and overrides the key in the settings files. But you have to type it every time.
  • The toggle in /memory. It writes autoMemoryEnabled to ~/.claude/settings.json, your global file for all projects on the computer. Use it in one project, and you turn memory off everywhere.

One more thing: in a background session, the toggle can only turn memory off, not back on. To enable it, use a normal session that you started yourself by running claude in the terminal.

Warning

Disabling memory does not delete anything Claude has already written. The memory folder stays on disk until you clean it up yourself.

What to do with old notes

The /memory command lists the memory files and lets you open any of them. They are ordinary text files: you can edit or delete them.

Do not delete them blindly; first look at what is there. In the rules-folder cleanup case described here, the agent had recorded unnecessary information about the user as part of its self-reflection. Cluttered rules are just as harmful as a cluttered root CLAUDE.md file full of outdated rules: the agent still uses them, hallucinates, and gives you poorer context.

You can ask the agent to do the cleanup. Once a week, you can give it a task like this for the business folder; it works for the memory folder too:

Your task is to find anything that is no longer relevant or is outdated, and prove that it really is outdated. You must not delete it yet; just find it and present it to me.

It brings you a list with evidence, and you decide what to delete. Move only the most valuable information from the notes into CLAUDE.md. There is an explanation of how to keep instructions short so that Claude follows them in a separate article. And how to organize project memory as a whole, with folders and rules, is covered in the article on the second brain.

Have you kept auto memory on or turned it off? Check what Claude has managed to remember about you. You can continue exploring Ailoot at ailoot.ai.

Sources

More details

Questions about How to disable Claude Code auto memory in one project

Which settings file disables memory only for me in one project?

Put "autoMemoryEnabled": false in that project’s .claude/settings.local.json. Use .claude/settings.json for a shared project setting. The /memory toggle changes the global setting, so it is unsuitable when neighboring projects must keep memory enabled.

Will disabling auto memory erase the old notes?

No. The memory folder remains on disk. Review its files before deleting anything, and preserve useful decisions elsewhere if needed. Restart Claude Code after changing project settings and check /status for the loaded setting source.

All articles