Why didn't "remember this" update CLAUDE.md?

/memory

Lists every CLAUDE.md and opens the auto memory folder, where the note actually went.

Answer

When you tell Claude to remember something, it writes to auto memory: notes Claude keeps for itself under ~/.claude/projects/<project>/memory/, loaded every session but written by Claude, machine-local and never committed. CLAUDE.md is not touched. To put an instruction there, say so, "add this to CLAUDE.md", or open the file from /memory and write it yourself. Both load at the start of every session; the difference is who writes it and who else gets it.

What it does

Claude Code has two memory systems, and "remember this" reaches only one of them.

CLAUDE.mdAuto memory
Who writes ityouClaude
What it holdsinstructions and ruleslearnings and patterns
Scopeproject, user or organisationone repository, shared across its worktrees
Where it livesin the repository or your home directory~/.claude/projects/<project>/memory/
Who else gets itwhoever the file is shared withnobody: machine-local, never in git
Loadedevery session, in full up to 4 MiBevery session, the first 200 lines or 25 KB of the index

A request like "always use pnpm, not npm" is a correction, and corrections are what auto memory is for. Claude saves four kinds of note and marks each with a type: user for your role and preferences, feedback for corrections and confirmed approaches, project for decisions it cannot derive from the code, reference for where things live outside the project. It skips anything it can read from the codebase and anything your CLAUDE.md already says.

The folder has an index and one file per topic:

~/.claude/projects/<project>/memory/
├── MEMORY.md           # index, one line per memory, loaded every session
├── user_role.md        # one memory
└── feedback_testing.md # one memory

Only the index loads at startup, and only its first 200 lines or 25 KB. The topic files are read on demand. Claude keeps the index short by moving detail into topic files, and Claude Code reminds it to when the index nears the limit.

So the note is real and it does come back next session. It is just not in the file you were looking at, and not in the file anyone else will see.

How to check

The interface says when it happens: Saved 2 memories or Recalled 2 memories means Claude wrote to or read from that folder.

To see what is there, open /memory and select the auto memory folder. It is plain markdown; read, edit or delete anything in it. /memory also lists every CLAUDE.md location, so the two systems are one command apart.

<project> is derived from the git repository, not the working directory: every worktree and subdirectory of one repo shares one memory folder. Outside a git repository the project root is used instead.

How to fix it

You wanted it in CLAUDE.md. Ask for that by name, "add this to CLAUDE.md", or open the file from /memory and write the line yourself. The instruction then travels with the repository and every session loads it in full.

You want both. Nothing stops you. Auto memory skips what CLAUDE.md already says, so once the instruction is in the file, the note becomes redundant and Claude will not keep a second copy.

You do not want Claude keeping notes at all. Toggle auto memory in /memory, which writes autoMemoryEnabled to ~/.claude/settings.json. For one project, set it in that project's settings:

{
  "autoMemoryEnabled": false
}

CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 does the same from the environment.

You want the notes somewhere else. autoMemoryDirectory in any settings scope, an absolute path or one starting with ~/.

Example

Ask Claude to remember a preference, and it lands in auto memory:

remember that the API tests need a local Redis instance

Ask for the file, and it lands in the file:

add to CLAUDE.md: the API tests need a local Redis instance running

Browse what has accumulated:

/memory

Common mistakes

Expecting the note on another machine. Auto memory is machine-local and stays out of cloud environments. Anything a colleague or a second laptop needs belongs in CLAUDE.md.

Treating the note as enforcement. Both systems are context, not configuration. Claude reads them and tries; an instruction that must run every time is a hook.

Expecting a subagent to know it. The main conversation's auto memory is not loaded into subagents, except a fork of the current conversation.

Assuming it was deleted with old sessions. Transcripts expire after the retention period; the memory folder is excluded from that sweep and stays until you or Claude edits it.