What your AI coding assistant remembers between sessions
AI coding assistants are not blank slates, but they do not keep everything. What carries over between sessions, what does not, and where a knowledge base helps.
By Fabian Mehlhorn
An AI coding assistant is not a blank slate between sessions, but it does not keep everything either. Two things are always true: the underlying model never learns from your chats, and the working context of a session is wiped when it ends. On top of that, most tools add some built-in memory that does carry over, though how much varies by tool. Below is the general picture, a concrete example from the tool I use, and where a searchable knowledge base fills the gap.
I had the wrong idea about this at first, so it is worth getting right.
The two things that are always true
- The model does not learn from your chats. When the assistant answers you, it is not updating its weights. The base model is frozen. Nothing you say in a session gets baked into the model for next time. This is true of every assistant, because they all sit on top of a fixed model.
- The session context is temporary. Everything the assistant "knows" during a session lives in its context window, the working memory for that conversation. When the session ends, that window is gone. Start again and it is empty except for whatever the tool loads at the start.
So on its own, the model cannot remember, and the place the session knowledge lived gets wiped. What saves you from total amnesia is the layer the tool adds on top.
What the tool adds (Claude Code as the example)
Different assistants handle this differently. I use Claude Code, so here is what it actually keeps:
- A memory file. Claude Code loads
CLAUDE.mdfiles in full at the start of every session, following a hierarchy (user, project, local). This is where fixed standards, build commands, and conventions live. Other tools have their own version of a rules or memory file. - Auto memory. On by default in recent versions. Claude writes its own learnings to a
MEMORY.md(plus topic files) under~/.claude/projects/<project>/memory/. Only the first ~200 lines or 25KB load at session start, whichever comes first; deeper topic files are read on demand. So it does remember things it figured out, within a limit. - Resumable history. Every session is saved locally.
claude --continuereopens the most recent one andclaude --resumelets you pick. The conversation is not gone, you just have to reopen it.
To work with these directly: /memory opens the loaded memory files so you can view and edit them, and /init generates a starter CLAUDE.md for a project. One subtlety worth knowing: after a /compact (when Claude condenses a long session to free up context), it re-reads the project CLAUDE.md from disk, but nested CLAUDE.md files in subfolders are not re-injected until Claude next reads a file in that folder.
The exact mechanics differ from tool to tool, but the shape is the same everywhere: a curated, always-loaded slice plus a way to reopen old sessions.
What it still does not do
- A brand-new session does not automatically include your previous conversation. You have to resume to get that back.
- The always-loaded memory is capped. Only a slice loads up front, and a large memory file both costs tokens and can dilute how well the model follows it. You cannot pile every lesson you have ever learned into the always-loaded files.
- The auto memory is machine-local and per-project. It does not follow you across machines, and it is not a shared team brain. (A project
CLAUDE.mdcan be committed to git and shared with a team, but that is a static file you maintain, not a growing searchable store.)
So the accurate picture is: your assistant remembers a curated, capped, always-loaded slice, and can recall a past conversation if you resume it. What it does not have out of the box is a large, searchable long-term store it can dip into on demand.
Where this bites a solo developer
The capped, always-loaded slice is the catch. You keep your most important rules in the memory file and the tool keeps recent learnings, but there is only so much room before it costs tokens and dilutes focus. So a lesson you learned a month ago, on a part of the project you have not touched since, is usually not in the slice that loaded today. When the assistant plans something there, the old mistake is out of sight, and it makes the same wrong call again.
The gap: a store you search when planning or building
The fix is not to cram more into the always-loaded files. It is to keep your lessons in a knowledge base behind an MCP server and let the assistant search it when it is planning or about to build something. It pulls back only the relevant past notes, right when it is deciding how to do the thing, so you are not capped by the always-loaded limit and not paying tokens for notes you do not need today. Because MCP is an open standard, the same store works whatever assistant you use, and it sits alongside the built-in memory rather than replacing it.
That on-demand, searchable layer is what changed my day-to-day. The full walkthrough is here: how to give your assistant a searchable memory. The most valuable thing to put in it is the stuff the assistant got wrong, covered in storing what the AI got wrong.
Not automatically in a new session, but most tools save the conversation locally so you can reopen it. In Claude Code that is
claude --continueorclaude --resume.Most have some. They load a memory or rules file and, increasingly, keep their own auto memory. What they lack by default is a large, searchable store they can query on demand.
This is part of a series on AI coding assistant memory. Next: the full build.