# 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](https://solostackkits.netlify.app/tools/claude-md-generator.html) 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](https://solostackkits.netlify.app/blog/claude-code-rules-not-loading.html).

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

8. **`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).
9. **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.
10. **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`.
11. **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](https://solostackkits.netlify.app/tools/subagent-builder.html) writes the file.
12. **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. If compaction itself is eating your sessions, see [Claude Code context filling up fast](https://solostackkits.netlify.app/blog/claude-code-context-filling-up-fast.html).

## 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](https://solostackkits.netlify.app/tools/hooks-settings-generator.html); hooks run as shell commands whatever Claude decides. For something that must never happen, use a `permissions.deny` rule ([permissions builder](https://solostackkits.netlify.app/tools/permissions-builder.html)). If Claude keeps asking for permission instead of remembering your allow rules, see [Claude Code keeps asking for permission](https://solostackkits.netlify.app/blog/claude-code-keeps-asking-for-permission.html).

## 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 |

---

Want durable instructions that load every session? The free [CLAUDE.md generator](https://solostackkits.netlify.app/tools/claude-md-generator.html) writes a short starting file, and the [subagent builder](https://solostackkits.netlify.app/tools/subagent-builder.html) adds `memory: project` when a subagent needs its own notes. Both run in your browser, no signup. More free builders and checkers: [solostackkits.netlify.app/tools/](https://solostackkits.netlify.app/tools/).

Facts on this page come from Anthropic's Claude Code docs on [memory](https://code.claude.com/docs/en/memory), the [settings reference](https://code.claude.com/docs/en/settings-reference), [environment variables](https://code.claude.com/docs/en/env-vars), the [CLI reference](https://code.claude.com/docs/en/cli-reference), [error messages](https://code.claude.com/docs/en/errors), [subagents](https://code.claude.com/docs/en/sub-agents), the [.claude directory](https://code.claude.com/docs/en/claude-directory), the [context window](https://code.claude.com/docs/en/context-window) and [debugging your configuration](https://code.claude.com/docs/en/debug-your-config). This guide isn't affiliated with Anthropic.

Want a tested starting point? Our [Claude Code Power Config Pack](https://solostackkits.gumroad.com/l/claude-code-config-pack/LAUNCH50?utm_source=hashnode&utm_medium=article&utm_campaign=ssk_hashnode_automemory) has 6 lean CLAUDE.md templates, permission presets and 8 tested safety hooks, $6 with the launch code while it lasts.

Not ready to buy? Our [free safety hooks](https://solostackkits.gumroad.com/l/claude-code-free-safety-hooks?utm_source=hashnode&utm_medium=article&utm_campaign=ssk_hashnode_automemory) block risky commands before they run.

