Anthropic & Claude

The Components of Agent Memory: Anthropic Has Claude Dream Between Sessions

3 min read AI-generated

Opus 5 was the first model to close the learning loop: a rule, how it knew the rule held, earlier answers and warnings about traps, all in one document. Sonnet 4.6 got as far as untested guesses.

Featured image for "The Components of Agent Memory: Anthropic Has Claude Dream Between Sessions"

On November 6, Anthropic’s engineering team wrote down how it thinks about memory for agents. The post is called “The components of agent memory,” and it is unusually concrete: instead of an architecture it shows measurements on real models, including the runs that went badly.

Memory here means one thing only: knowledge Claude gains from experience and keeps between sessions, saved as context it can read later. Weight changes don’t count. Neither does in-context learning. And compaction certainly doesn’t, since that is just a summary replacing older turns.

Dreaming means reading your own logs while idle

The template is the hippocampus. Humans encode experiences in the moment, but only some of them become long-term knowledge, and the selection appears to happen offline: during sleep and quiet rest, the brain replays recent experience and pushes it into the neocortex.

Agents can split the work the same way, because they already capture what they do in logs and transcripts. Researchers at Letta and UC Berkeley had proposed sleep-time compute for this. Anthropic calls the version where a model rereads logs, fixes mistakes, writes notes and builds new representations “dreaming.” What comes out of it also decides what gets preloaded into later sessions.

The second building block is the note itself. Claude can tag salient events in a log as they happen, or write them into a folder of memory notes. Which raises the awkward question: how does a model tell in the moment what will matter later, before it knows what is coming?

What the models learned on CL-Bench

Anthropic ran a task from Continual Learning Bench 1.0 in Claude Managed Agents, each question in a fresh session, with a memory directory as the only thread between them. After every answer the model is told the correct solution and may write a memory.

The results differ less in benchmark score than in the shape of the notes. Sonnet 4.6 got as far as theories about why an answer was wrong: scattered files full of untested guesses. Opus 4.7 consolidated everything into one reference document and marked which facts it had checked. Sonnet 5 ticked an answer off once the grader confirmed it and wrote a correction when it had been wrong. Opus 5 was the first model to close the loop: a rule, how it knew the rule held, answers to earlier questions, plus warnings about traps. Opus 5.5 and Sonnet 5.5 close it too, landing near Opus 5 with memory and slightly above it without.

Fewer notes are the better notes

The sharpest comparison comes from Pokemon Red. Each model was handed a folder of memory files it could read from and write to. After roughly 10,000 steps, Sonnet 3.7 had created 413 files across 225 folders, an archive of encounters, often one file per battle, per item, per NPC. It had one badge. Fable 5 had nine files in two folders plus a global.md, and four badges.

Sonnet 3.7 wrote nothing false. It wrote too much, and because the game state keeps changing, its archive was permanently out of date. That is exactly why memory is a prediction rather than a transcript: writing down a rule is a claim that the pattern will come back. The newer models have gotten good at making that call, and they stay short because of it.

Sources

AnthropicAgentsMemory