Claude Code Auto Memory Not Working? The 200-Line Limit That Hid My Newest Memories
On this page
In the October 2026 audit of my Claude Code knowledge base one failure stood out for day-to-day work: Claude Code auto memory not working the way I expected. My 13 newest memories never reached a new session. This post is that row alone — symptom, cause, a one-minute check, and the rewrite that took my auto-memory index from 202 lines to 102.
It sits next to Layer 2 in the five-layer Claude Code memory system and next to the CLAUDE.md trim. Examples use Acme and Example Client, never real clients.
Symptom: Claude forgets what it learned last week
The symptom looks like this: you correct Claude, it saves the memory, and a fresh session acts as if the correction never happened.
In my case the topic files existed and the index listed them, but the 13 newest entries were below line 200.
Cause: only the first 200 lines or 25 KB load
The Claude Code memory docs are explicit about how auto memory loads:
The first 200 lines of
MEMORY.md, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start.
That limit is on the index only. Topic files under the auto-memory folder are not loaded at startup; Claude reads them on demand when it needs them. If the index never points at a topic file inside the load window, that memory stays invisible at session start.
My auto-memory MEMORY.md was 202 lines. New memories were appended at the bottom. The 13 newest sat past the 200-line window, so they were never read. Nothing in my setup failed loudly. The index looked healthy if you opened the whole file; Claude only ever saw the top of it.
Check yours in one minute
Auto memory lives under the project memory directory the docs describe: ~/.claude/projects/<project>/memory/. Inside it you get a MEMORY.md index and one topic file per memory. You can also open the folder from a session with /memory.
From your shell (placeholders only — use your own project directory name):
# Line count of the auto-memory index
wc -l ~/.claude/projects/<project>/memory/MEMORY.md
# Size of the same file
du -h ~/.claude/projects/<project>/memory/MEMORY.md
If wc -l is over 200, or du shows more than 25 KB, the bottom of the index is outside the load window. Open the file and look at the last entries: those are the ones Claude may never see at session start.
Fix: group by topic and keep the index short
I did not delete the memories. I rewrote the index the way the docs describe Claude keeping it concise: one line per entry, detail in topic files, stale rows merged or dropped.
What I changed:
- Group by topic instead of a chronological dump with the newest at the bottom.
- One line per memory in
MEMORY.md, linking to the topic file that holds the detail. - Keep the whole index well under 200 lines / 25 KB so every link sits inside the load window.
After the rewrite the index was 102 lines, and all 239 memories were still linked. Every link, including the newest, now sits inside the load window.
Move durable facts out of auto memory
Auto memory is the session learner: preferences, corrections, patterns Claude writes for itself. Per the docs it is machine-local, with one directory per git repository, and it is not shared across machines or cloud environments. It is a poor home for facts you want durable, reviewable, and shared across tools.
I move long-lived facts into the knowledge-base repo — client files for Acme and Example Client, playbooks, decisions — and keep that repo’s own index short. That split is the same idea as Karpathy’s LLM Wiki: a short schema and index, with synthesis in topic files. The always-on rules stay in one AGENTS.md (see the CLAUDE.md size post); the wiki holds knowledge; auto memory stays small.
The free personal-memory template is the durable home I point people to: one rules file, size limits, client folders, and /setup. Use it for facts that should outlive a single project’s auto-memory folder.
What newer Claude Code versions do differently
When I hit this, a write past the limit did not alert me. The current docs describe a clearer feedback loop after Claude writes to MEMORY.md:
- If the file is near a limit, Claude Code reminds Claude to shorten it — keep one line per entry, move detail into topic files, merge or drop stale entries.
- If the file is over a limit, the write still succeeds, but Claude Code returns an error telling Claude to rewrite the index, because everything past the limit is dropped on the next load.
I still treat the load window as a hard constraint, not something the reminder will manage for me. Group by topic, keep the index short, and put durable facts in the knowledge base so the index never has to grow into a dump again.
Start from the template
👉 github.com/Sinfjell/personal-memory-template — click Use this template, make the copy private, run /setup. Product page: /products/personal-memory-template/.
The March post is still the architecture. The seven failures post is the audit table. This post is the auto-memory row.
Subscribe below if you want the later pieces in the series by email.
FAQ: Claude Code auto memory
Why is Claude Code auto memory not working?
Often the auto-memory index (MEMORY.md) is past the load window. The Claude Code memory docs say only the first 200 lines or 25 KB load at session start. If new memories were appended below that, Claude never sees them until you shorten the index.
Where is the Claude Code auto memory folder?
Per the docs, each project stores auto memory at ~/.claude/projects/<project>/memory/. That directory holds a MEMORY.md index plus one topic file per memory. Open it from a session with /memory, or check the path from your shell.
How large can Claude Code auto memory MEMORY.md be?
Only the first 200 lines or 25 KB of MEMORY.md are loaded at the start of a conversation, whichever comes first. Content past that threshold is not in context at session start. Keep the index short — one line per memory — and put detail in topic files.
Should durable facts live in auto memory or a knowledge base?
I keep auto memory for preferences and corrections that Claude writes itself. Durable facts (client stack, deploy quirks, decisions for Acme or Example Client) go in a versioned knowledge-base repo, indexed by topic. The free personal-memory template is that durable home.
How do I fix a Claude Code MEMORY.md that is over the limit?
Group entries by topic, keep one line per memory, merge or drop stale rows, and move durable facts into topic files or your knowledge base. After my October 2026 audit the index went from 202 lines to 102, with all 239 memories still linked.
Stay in the loop
Productivity tips, tool reviews and early access to new products, straight to your inbox.