What happens
An agent only knows what is inside its context window. Every message, file and tool result goes in. In a long session the window fills.
When it fills, the agent compacts: it replaces the work it was holding with a summary. The summary is a guess at what mattered, and nobody checked it. Some of what you told the agent is gone. Some of what survives is a wrong guess kept as fact. When the session ends, the window closes and the rest goes with it. Then you re-explain.
The markdown-file workaround, and why it rots
Many people have the agent write notes to a markdown file and read it at the start of the next session. It helps for a while. Then it rots. The agent writes whatever it likes, and nothing is checked. No entry says who wrote it or who approved it. A new note and an old note contradict each other, and the agent has no way to know which one is right. A wrong guess sits in the file as fact.
Why a bigger window does not fix it
A bigger window delays the wall. It does not move it. The window still fills, the session still ends or compacts, and what survives still cannot be audited. Nothing outside the model fixes the context window.
The paste
Install:
pip install magnemo
or run it with uvx magnemo-mcp. Make a vault, which is a folder of plain markdown files you own:
magnemo init ./vault
Add this to your Claude Desktop or Cursor config. Claude Code and any other MCP client work too.
{"mcpServers":{"magnemo":{"command":"magnemo-mcp","env":{"MAGNEMO_VAULT":"/absolute/path/to/vault"}}}}
The agent gets four tools: retrieve, stage, bootpack and handoff. It can only stage a note. Nothing is kept until you run magnemo yes. Every entry carries who wrote it, who approved it, and when. A newer note supersedes an older one, and the older one is archived with its words. The next session boots from the record.
Related questions
What is a memory MCP server? It is a local server that gives an agent tools to read and propose notes; see /memory-mcp.
How do I give Claude Code a memory? Add the config block above and run magnemo init; see /claude-code-memory.
What is agent amnesia? It is the agent forgetting what it was doing, or keeping a wrong guess as fact, after the window closes; see /agent-amnesia.
Sessions die. The memory doesn't.