Does Claude Code remember previous sessions?
Some of it, through three separate mechanisms: CLAUDE.md, auto memory, and --continue. None of them keeps a record of the actual work.
The three things that do carry across
| CLAUDE.md | Instructions you write yourself, loaded at the start of every session. Great for standing rules: build commands, conventions, architecture. It's what you've decided should always be true, not a record of anything that happened. |
| Auto memory | Notes Claude writes on its own, per repository, on by default. It captures your preferences and corrections. The index file loads every session; the detail files only load when Claude actually reaches for them. |
| --continue and --resume | Reopens a recent session in the current directory. For "I closed the terminal an hour ago," this is the right tool, and nothing improves on it. |
So the answer is yes, partly. A lot of what's written on this still says no — that stopped being true a while ago.
What none of them carry
All three keep the conclusion. None of them keeps the work.
Picture a Tuesday afternoon spent wrestling a connection pooler. You try four configurations, three fail for different reasons, and the fourth finally works because transaction pooling rewrites the session and breaks named prepared statements. Six weeks later:
- CLAUDE.md only has it if you stopped mid-debug to write it down, which you didn't, because you were busy debugging.
- Auto memory might hold "prefers the direct connection": a preference, not a reason. It deliberately skips anything it judges derivable from the codebase.
- --continue can't reach it at all. The session isn't recent, and might not even be in this directory.
The three failed attempts are the genuinely valuable part, and they're exactly the part with no mechanism to keep them.
Four more limits worth knowing
| One tool | All of it belongs to Claude Code. A session you ran in another AI coding tool is invisible to every one of these mechanisms, Claude included. |
| One machine | Auto memory is machine-local by design. Your laptop and your desktop each build up their own, separate copy. |
| Thirty days | Transcripts get deleted after cleanupPeriodDays, 30 by default. The raw record of what happened has an expiry date on it; auto memory is excluded from that sweep, but the transcripts aren't. |
| You have to ask | Resuming only happens on purpose. Mid-task, Claude can't go check whether it's solved this exact problem before, because nothing gives it a way to look. |
Closing the gap
The transcripts are already sitting on disk. Indexing them turns that record into something searchable, and registering the index as an MCP server is what lets the assistant search it without you asking:
> have we hit this pooler error before? recall_search returns the Tuesday session, including the three attempts that failed and why
Use it alongside the built-ins, not instead of them. CLAUDE.md is still the right place for standing rules, and --continue is still the right way to reopen this morning's session. See what --continue doesn't cover.
Questions
| Does Claude Code remember previous conversations? | Partly. Three mechanisms carry things across: CLAUDE.md files you write yourself, auto memory that Claude writes on its own per repository, and --continue or --resume, which reopen a recent session in the current directory. All three preserve conclusions. None of them preserves the work that produced those conclusions, and none of them can be searched by the assistant mid-task. |
| Where does Claude Code store its memory? | Auto memory lives in ~/.claude/projects/<project>/memory/, as a MEMORY.md index plus one file per topic. CLAUDE.md files live in the project itself, in ~/.claude/, and at a managed policy path. Session transcripts are stored separately, in ~/.claude/projects/<project>/<uuid>.jsonl. |
| How long does Claude Code keep session transcripts? | Thirty days by default. Anthropic's documentation states that clients store transcripts locally in plaintext under ~/.claude/projects/ for 30 days to enable session resumption, and that the period is set by cleanupPeriodDays. The auto memory directory is excluded from that cleanup; the transcripts themselves aren't. |
| Can Claude Code see sessions from other AI coding tools? | No. Every built-in memory mechanism is scoped to Claude Code only. Each tool writes its own transcripts in its own format, in its own folder, and none of them reads another's. One history spanning all six needs something built to read all six formats. |
| Is auto memory the same as a memory MCP server? | No. Auto memory is notes Claude chooses to write about your preferences and corrections, per repository, on your own machine. A memory MCP server is a tool the assistant calls directly. They answer different questions and work well together. |
| Why does Claude forget things inside one long session? | That's compaction, not memory. When a session outgrows the context window, it gets summarized and the conversation continues from that summary, which keeps conclusions and drops the reasoning behind them. The full transcript stays on disk the whole time. |
More notes
| Claude Code has auto memory. Where it stops. | Auto memory writes notes about your preferences per repository, on one machine. What it is good at, the four boundaries it does not cross, and what to pair it with. |
| Context left until auto-compact: what the number counts | The percentage in the status line, what makes it fall, how to move the threshold, and what actually happens to your conversation when it reaches zero. |
| /clear vs /compact in Claude Code | One summarizes the conversation and keeps going. The other starts a fresh one. What each does to the transcript on disk, and which to reach for. |