What happens at compaction
Every long session hits the same wall. The context fills, Claude Code compacts, and the work it was holding turns into a summary nobody checked. From there the agent forgets what it was doing, or keeps a wrong guess as fact, and you re-explain.
That is the model, not your prompt. The window closes, compaction guesses at what mattered, and what survives can't be audited.
The record the next session boots from
MAGNEMO keeps the record outside the model, in a vault on your own computer. It exposes four verbs for memory:
retrievereads the canon, the notes you have approved.stagelets the agent propose a note.bootpackreturns what the next session reads first.handoffcloses a session with a note for the next one.
Three more carry your answer: keep and drop carry your yes or no, and pending lists what waits.
Through the server, an agent can only stage a note, and it cannot keep one on its own authority. When you say keep in the chat, the agent carries your yes with keep, and the record says the yes came from the chat. magnemo yes at your terminal is the verified yes. A yes in the chat counts half in the trust arithmetic, at most 50 notes a day are kept that way, and a note held for a secret or an injection needs a verified yes. See /day-500. 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, never overwritten.
So the loop is: Claude Code stages notes as it works, you say keep on the ones that are right, and at the end of a session it calls handoff. The next session calls bootpack and starts from that approved record, not from a guess.
Notes that look like secrets or injected instructions are tainted when they arrive and are never served through the server.
The paste for Claude Code
Install it and make a vault:
pip install magnemo
magnemo init ./vault
You can also run it with uvx magnemo-mcp. Then add this to your Claude Code MCP config, using the absolute path to your vault:
{
"mcpServers": {
"magnemo": {
"command": "magnemo-mcp",
"env": {
"MAGNEMO_VAULT": "/absolute/path/to/vault"
}
}
}
}
The one variable is MAGNEMO_VAULT.
Related questions
Why does my agent forget in the first place? The context window fills and compaction summarizes it without checking, which is covered in /why-does-my-agent-forget.
What is a memory MCP server? It is a tool your agent calls to read and write notes that live outside the model, explained in /memory-mcp.
Does the same vault work in Cursor? Cursor takes the same config shape and the same vault; it is untested here, and is described in /cursor-memory.
Sessions die. The memory doesn't.