Solo Stack Kits Directory
Claude Code workflows & skills for solo consultants and freelancers

← Blog · 2026-10-20

Claude Code Auto Memory Not Working? 12 Causes and Fixes

Shortcut: anything Claude must know in every session belongs in a CLAUDE.md you write, not in auto memory. Our free CLAUDE.md generator builds one from a short form in your browser. If your CLAUDE.md itself is being ignored, see CLAUDE.md or .claude/rules not working? 12 causes and fixes.

Claude Code carries knowledge across sessions in two ways:

CLAUDE.md files Auto memory
Who writes it You Claude
Where it lives ./CLAUDE.md, ./.claude/CLAUDE.md, ~/.claude/CLAUDE.md and others ~/.claude/projects/<project>/memory/
What loads at session start The whole file (files over 4 MiB are skipped) The first 200 lines or 25KB of MEMORY.md, whichever comes first
Default Loads when present On in local sessions

Auto memory is a folder of plain Markdown notes: a MEMORY.md index with one line per memory, plus topic files such as feedback_testing.md. Claude saves four kinds of notes: user (your role and preferences), feedback (corrections and approaches you confirmed), project (ongoing work and decisions it can't get from the code or git history) and reference (where to find things outside the project).

First: see what's there

Run /memory. It shows the auto memory toggle and has an option to open the auto memory folder, so you can read exactly what was saved. Run /context to see which CLAUDE.md and auto memory files loaded into the current session. While Claude works with memory you see messages such as "Saved 2 memories" or "Recalled 2 memories".

If the folder is empty, Claude never saved anything (checks 1-7 and 10). If it has the note but Claude doesn't act on it, see checks 8, 9, 11 and 12.

Nothing gets saved or loaded: 7 causes

  1. Auto memory is turned off in settings. The /memory toggle saves autoMemoryEnabled to your user settings at ~/.claude/settings.json, and the key can also sit in a project's .claude/settings.json or .claude/settings.local.json. With false, Claude doesn't read from or write to the memory folder. Fix: turn the toggle back on in /memory, and look for "autoMemoryEnabled": false in each settings file. A project-level false is the documented way to turn it off for one project only.
  2. An environment variable or launch mode overrides the setting. CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 turns auto memory off and takes precedence over autoMemoryEnabled for that session. --bare (which sets CLAUDE_CODE_SIMPLE) and --safe-mode (or CLAUDE_CODE_SAFE_MODE=1) skip auto memory along with CLAUDE.md, and CLAUDE_CODE_DISABLE_CLAUDE_MDS=1 stops user, project and auto memory files from loading. Fix: check your shell profile, CI config and the env block of your settings files. CLAUDE_CODE_DISABLE_AUTO_MEMORY=0 forces auto memory on even when --bare or autoMemoryEnabled: false would turn it off.
  3. The session can't turn it back on. In a background session, or a session another Claude Code session started (for example when Claude runs claude through its Bash tool), the toggle can turn auto memory off but not on. It reads off · can't be turned on here; use a session started outside Claude Code. Fix: run claude directly in your terminal and use the /memory toggle there.
  4. It's a self-hosted environment. Auto memory is on by default in local sessions, but a session in a self-hosted environment runs with it off by default (Claude Tag sessions are the exception). Memory is also machine-local: files aren't shared across machines or cloud environments. Fix: put anything that must follow you between machines in a CLAUDE.md that's committed to the repository.
  5. You're in a different project folder. Each project gets its own memory folder, keyed by the git repository, so all worktrees and subfolders of one repo share it. Outside a git repo, the folder is keyed by the project root instead, so starting Claude Code from a different folder means a different, possibly empty, memory. Fix: start Claude Code inside the same repository. To share one memory across launches on purpose, set CLAUDE_CODE_PROJECT_DIR_NAME together with CLAUDE_CONFIG_DIR (v2.1.234 or later); memory then lives under that config directory's projects/ folder.
  6. autoMemoryDirectory points somewhere that's ignored. You can move memory with autoMemoryDirectory, which must be an absolute path or start with ~/. Set in a project's .claude/settings.json or .claude/settings.local.json, it's honored only under the same workspace trust rule as hooks. While permissions.blockReadsOutsideWorkingDirectories is on, a directory chosen by a repository-supplied settings file loads no memory and gets none saved to it. Fix: set autoMemoryDirectory in ~/.claude/settings.json instead, with an absolute or ~/ path.
  7. The notes were deleted. Auto memory files are plain Markdown that you or Claude can edit or delete. The cleanup sweep that removes old session transcripts after cleanupPeriodDays skips the memory folder, but before v2.1.228 it could delete files in folders inside the memory directory. Fix: update Claude Code (claude --version shows your version), and treat memory as notes, not a backup. Facts you can't afford to lose go in CLAUDE.md.

Saved, but Claude doesn't recall it: 5 causes

  1. MEMORY.md is over its read limit. Only the first 200 lines or 25KB of MEMORY.md, whichever comes first, load at session start; anything past that is dropped every time. When a write leaves the index over a limit, Claude Code sends Claude an error such as this write left the memory index at MEMORY.md at 214 lines, over its 200-line read limit. It goes to Claude after the write, not as a banner in your terminal, so you may only see it in the transcript. Before v2.1.210 an over-limit index was cut off silently. Fix: ask Claude to rewrite MEMORY.md: one line per entry, detail moved into topic files, stale entries merged or dropped. YAML frontmatter and block-level HTML comments don't count toward the limit (from v2.1.211).
  2. The note is in a topic file. Topic files such as feedback_testing.md don't load at startup. Claude reads one on demand, with its normal file tools, when the task seems to need it. Fix: make sure MEMORY.md has a line pointing to the topic, or ask directly: "check your memory for how we run tests". If Claude needs it every time, move it into CLAUDE.md.
  3. Claude decided not to save it. Claude doesn't save something every session; it keeps what it judges useful in a future conversation. It skips anything it can work out from the codebase, such as architecture, file paths or debugging fixes, and anything your CLAUDE.md files already say. Fix: say it outright: "remember that the API tests need a local Redis instance". That goes to auto memory. To put an instruction in CLAUDE.md instead, say "add this to CLAUDE.md" or edit the file yourself through /memory.
  4. A subagent is doing the work. Subagents don't get the main conversation's auto memory; the exception is a fork, which inherits the parent conversation. A subagent can keep its own memory with the memory field in its frontmatter: user (~/.claude/agent-memory/<name>/), project (.claude/agent-memory/<name>/) or local (.claude/agent-memory-local/<name>/). It has no effect while auto memory is off. Fix: add memory: project to the subagent and tell it in its prompt to check and update its memory. Our free subagent builder writes the file.
  5. It was only said in conversation. After /compact, auto memory and your project-root CLAUDE.md are re-read from disk, but instructions you only typed in chat get summarized with the rest of the conversation. Fix: ask Claude to remember the instruction, or add it to CLAUDE.md, so it's on disk and survives compaction.

Memory is context, not a rule

Claude treats both CLAUDE.md and auto memory as context, not enforced configuration, and specific, concise notes are followed more consistently. If something must happen at a fixed moment, such as a check before every commit, make it a hook; hooks run as shell commands whatever Claude decides. For something that must never happen, use a permissions.deny rule (permissions builder).

Quick reference

Symptom Likely cause Fix
Memory folder empty, toggle off autoMemoryEnabled: false Toggle on in /memory; check every settings file
Toggle on, still nothing CLAUDE_CODE_DISABLE_AUTO_MEMORY, --bare, safe mode Unset, or CLAUDE_CODE_DISABLE_AUTO_MEMORY=0
"can't be turned on here" Background session or one started by Claude Run claude directly in a terminal
Memory gone in another folder or machine Memory is per repository and machine-local Same repo; shared facts in committed CLAUDE.md
Old entries ignored MEMORY.md past 200 lines or 25KB One line per entry, detail in topic files
Detail not recalled It's in a topic file read on demand Ask Claude to check memory, or move it to CLAUDE.md
Subagent doesn't know Subagents don't load your memory memory: project in the subagent

Facts on this page come from Anthropic's Claude Code docs on memory, the settings reference, environment variables, the CLI reference, error messages, subagents, the .claude directory, the context window and debugging your configuration. This guide isn't affiliated with Anthropic.

Want it set up already? Claude Code Power Config Pack

Fixed it? Skip the next one with a tested Claude Code setup you can drop into any repo.

One install command that backs up your settings first. Checked against the official Claude Code docs. MIT licensed.

Get the Config Pack: $12

Prefer to build it yourself? Use the free Claude Code tools, no sign-up.