# My LLM agents forget conversation history when I restart them, how do I fix this?

> Source: <https://dev.to/izgorodin/my-llm-agents-forget-conversation-history-when-i-restart-them-how-do-i-fix-this-2c4c>
> Published: 2026-09-17 05:47:00+00:00

You close the terminal on Friday with the agent halfway through a refactor it understands better than you do by now. On Monday you open a new session, ask it to continue, and it asks which project this is. Nothing in the tool is broken, and that is the first thing worth clearing before any fix. Every one of the five coding tools I checked, Claude Code, Cursor, Codex, VS Code and Windsurf, already ships a working way to reopen the previous conversation. Nothing is broken. The gap people are actually hitting is narrower than "my history is gone", and naming it precisely is the whole point.

Comparing memory across five products is meaningless until the word is split. Four questions separate cleanly, and the five answer them differently: can you return to the same conversation; what degrades even when you do; what a brand new session still loads from disk regardless; and whether there is built-in memory that the agent writes for itself and reads back later. Every fact below comes from a page the vendor published, re-checked on 2026-09-12, and the page for each is named on the [full write-up](https://mnemoverse.com/docs/library/what-survives-when-ai-agents-restart).

Claude Code documents five entry points, among them a flag for the most recent session in the current directory and a picker, and states that a resumed session restores the conversation together with the state saved in it. Its documentation also names what does not come back, which is easy to miss: flags for MCP configuration, settings and added directories have to be passed again.

Cursor resumes only from its CLI and documents three ways, "To resume the most recent conversation, use `agent resume`, `--continue`, or the `/resume` slash command", plus a session list to pick from. Codex resumes the last session or a chosen one, with its resume commands marked stable in its own reference. VS Code needs no flag: its agent sessions view restores previous sessions in the interface. Windsurf, now Devin Desktop, resumes from its CLI and from the history panel in the desktop app.

The practical consequence is small and useful. If what you lost was the conversation you were just in, you did not lose it. You started a new one instead of reopening that one.

Claude Code states it outright: each session begins with a fresh context window. A new task, a new terminal, a different day, and none of the five carries the earlier conversation into it. That is the case people actually mean when they say the agent forgets, and it is not a bug in any of the five. It is the unit of persistence being the session.

What every one of the five does reload in a new session is the static instruction file a person wrote. VS Code calls them always-on instructions, included in every chat request. Cursor reads its own rules format and other tools' files as well. Windsurf's default agent injects rules at the start of every session. That is why a fresh session still knows your conventions while knowing nothing about last week, and it is also not memory: an instruction file is a thing a person decided once, and memory is what the agent accumulated from what actually happened.

All five document compaction, and here they stop agreeing. Claude Code is the only one that documents a choice rather than a silent swap: on Pro and Max plans, resuming a session idle for more than about an hour and over a hundred thousand tokens opens a dialog with three options, resume from summary, resume the full session as is, or stop asking. It is also unusually specific about the loss: its documentation says the summary replaces the verbatim conversation, that full tool outputs and intermediate reasoning are gone, and that the instruction file, the auto memory and up to five recently modified files are re-read from disk.

Codex compacts on command and automatically at a configurable token limit, unset by default. VS Code is explicit about the loss and silent about the trigger: "important details from early in a long conversation might be compressed or lost", and no threshold appears anywhere in its current pages. Cursor documents that every chat shares a fixed context window and that the agent compacts as it fills, but names neither a threshold nor what is dropped. Windsurf documents a background compaction and a forced one, and says nothing about what a compaction keeps.

One line to carry: if a new session knows your conventions but not last week, memory is not failing. An instruction file is working, and there is no memory at all.

| tool | resume | what compaction drops | loaded in a new session | built-in cross-session memory | 
|---|---|---|---|---|
| Claude Code | five documented entry points, transcripts on disk | tool outputs and intermediate reasoning gone; instruction file, auto memory and up to five recent files re-read | instruction files, every session | yes, on by default, four note types, per project | 
| Cursor | CLI only: resume, continue, or a session list | mechanism documented, threshold and contents not | rules, AGENTS.md and other tools' files | contested: made generally available in July 2025, the interface for managing it removed in the 2.1.x series in November 2025 per the vendor's own forum, with no changelog entry; the same staff account said in January 2026 that only the interface went and the feature still works | 
| Codex | resume last or chosen, marked stable | manual command plus an automatic limit, unset by default | instruction file, rebuilt every launch | yes, off by default, in its own words | 
| VS Code | sessions restore in the interface | detail from early in the conversation may be lost, no threshold named | always-on instruction files, automatically | yes, experimental and on by default per the settings reference, three local scopes | 
| Windsurf (Devin Desktop) | CLI flags and a history panel | forced and background compaction, contents not described | rules injected at the start of every session | no, for the current default agent, stated in a warning callout | 

Claude Code has auto memory, on by default in its own words. It writes four kinds of note for itself, tagged in the file: your role and preferences, corrections you gave it, ongoing project decisions that cannot be derived from the code or git history, and pointers to where information lives outside the project. Each project gets its own memory directory, and it loads at the start of every session alongside the instruction file.

Codex has memories, and they are off until you turn them on: "Local Codex memories are off by default."

VS Code shipped a memory tool with three scopes stated in a table: user memory persists across sessions and workspaces, repository memory persists across sessions but is workspace scoped, and session memory is cleared when the chat ends. All three are stored locally. Its settings reference lists the switch as experimental, describes it as enabling the tool "so agents can save and recall notes across conversations", and prints true in the Default column.

Cursor is the one everybody gets wrong in both directions. There is no reference page for the feature, and the rules page points the persistent layer elsewhere: "Large language models don't retain memory between completions. Rules provide persistent, reusable context at the prompt level." Stopping there yields "Cursor has no memory", which is false: version 1.0 introduced it, "With Memories, Cursor can remember facts from conversations and reference them in the future", and 1.2 made it generally available. Then the interface for managing it went in the 2.1.x series in November 2025, with no changelog entry anywhere; the vendor's own support forum is the only place that states it, and the same staff account has since said both that the feature was removed and that only the interface went while the feature itself still works, managed by chat commands. I am reporting both statements because both are the vendor's.

Windsurf needs its qualifier every time. Memories belong to the legacy Cascade agent, and the current default agent, Devin Local, is not Cascade. A warning callout at the top of the memories page and a line on the default agent's own page say the same thing: the default agent does not persist memories between sessions. Cascade's feature remains real and documented. What changed is which agent a new tab opens.

One separation is worth making, because it is where most of the confusion arrives from. In late August 2026 Anthropic unified memory between its chat product and Cowork. That announcement is about the assistant applications and is precise about defaults: on by default on Free, Pro and Max plans, saving sensitive topics off by default, admin controlled on Team and Enterprise. Its body does not mention the coding tool or the API at all. So enabling memory in the chat app changes nothing about the agent in your terminal, and the auto memory in the coding tool is a different feature with a different scope. Same company, same word, two mechanisms.

I work on one, so weigh this section hardest. Resume is a client feature, and a memory layer neither replaces nor competes with it: with or without one connected, the resume command behaves the same. What a layer adds is exactly the gap in the new session. A fact written once comes back in any later session, including a brand new one, on another day, and in a different tool entirely, because it lives outside the session rather than inside it.

Two limits belong here, stated as plainly as the gaps above. The first is that this depends on the agent actually calling the write and the read; a tool being available is not the same as a model choosing to use it, which is why the standing-instruction technique exists at all. The second is that Claude Code's auto memory is a genuine close relative of the same idea, on by default, and saying otherwise would be false. The difference is scope: that directory is one tool and one project's worth of notes, while a memory layer follows one account across every connected tool. That is a real difference, and it is not a claim that their feature is worse.

Open the tool you use most and resume yesterday's session rather than starting a new one. Then start a genuinely new session and ask it something only the earlier conversation could answer. If the new session knows it, cross-session memory is on. If it knows your conventions but not the conversation, what you have is the instruction file doing its job. Then check whether your tool's memory feature is enabled, which is not the default in one of the five and no longer has an interface in another. Finally, if you work across two tools, ask the second one the same question, because that boundary is the one none of the five crosses on its own.

*Disclosure: I work on [Mnemoverse](https://mnemoverse.com), a persistent memory layer for AI agents connected over MCP, so weigh the last two sections accordingly. The full comparison with every source page is on our library.*
