Claude Code forgot your auto memory. Trim MEMORY.md past 200 lines or 25KB
Only the first 200 lines or 25KB of MEMORY.md load each session. Everything after is dropped until you shorten the index into topic files. Short answer: 5 steps. 1) Confirm auto memory is on and find the project folder; 2) Check MEMORY.md against the 200-line / 25KB load cap; 3) Rewrite the index: one line per entry, detail in topic files; 4) Verify with /context all, then restate what must always apply; 5) Remember auto memory is machine-local.
Last updated: · This page is the decision checklist; the tools list for “Fix Claude Code auto memory that seems forgotten” is a separate URL.
How do I keep Claude Code MEMORY.md under 200 lines or 25KB?
Confirm auto memory is on and find the project folder
Run `/memory` and check the auto memory toggle (`autoMemoryEnabled` in `~/.claude/settings.json`). Auto memory is on by default in local sessions; self-hosted environments default off, and `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` turns it off. Open the auto memory folder from `/memory`—it lives under `~/.claude/projects/<project>/memory/` (shared across worktrees of the same git repo). Docs: https://code.claude.com/docs/en/memory
Check MEMORY.md against the 200-line / 25KB load cap
Session start loads only the first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first. Content past that threshold is not in context. Topic files in the same directory are read on demand via the index—they are not fully inlined at launch. If Claude “forgot” something you know is in the file, it is often past this cutoff.
Rewrite the index: one line per entry, detail in topic files
Edit `MEMORY.md` so each memory is a short index line pointing at a topic file (for example `feedback_pnpm.md`). Move long notes out of the index. After oversized writes, Claude Code may return an error asking Claude to rewrite the index because everything past the limit is dropped on the next load—do that rewrite yourself if the session already forgot the tail.
Verify with /context all, then restate what must always apply
Run `/context all` and inspect Memory files. Auto memory should appear; if the note must never depend on truncation, promote it into project `CLAUDE.md` (full file loads at launch if ≤4 MiB) instead of relying on a huge `MEMORY.md`. Debug guide: https://code.claude.com/docs/en/debug-your-config
Remember auto memory is machine-local
Auto memory is not synced across machines or cloud environments. A Cloud Agent or another laptop won’t see `~/.claude/projects/.../memory/`. Put shared standing instructions in committed `CLAUDE.md` or `.claude/rules/`, and keep personal corrections in auto memory on the machine where you work.
Which tools are best to fix Claude Code auto memory that seems forgotten?
How Claude remembers your project
CLAUDE.md vs auto memory, MEMORY.md load limits, and /memory.
Debug your configuration
Use /context all to see which memory files loaded.
Explore the .claude directory
Where project vs user config and memory files live.
Claude Code overview
Product docs hub for CLI, desktop, and IDE sessions.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Fix Claude Code auto memory that seems forgotten” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.