Anthropic introduced a setup that stores and organizes memories so agents can use past work in later sessions. Developers can use idle time to correct logs and build navigation maps, designing what to remember and when to revisit it.
1. Four layers connect logs to context for the next session
Memory is knowledge gained from experience and stored for later sessions. Its four layers are searchable work logs, notes preserving key details, a wiki linking them, and context preloaded for the next session. Lower layers hold raw material; upper layers hold organized knowledge and ready-to-use memories.
Dreaming revisits logs during idle time between sessions to revise or reorganize notes. Anthropic applied idle-time compute, computation performed while not working, to memory organization, drawing on ideas proposed by Letta and UC Berkeley researchers.
2. Memory worked better when agents decided how to use it
For CL-Bench 1.0 database tasks, Anthropic opened a new session for each question, carrying over only the memory directory. After receiving feedback on correctness, models could review failures and save rules for later questions. The company reported higher average rewards, meaning average task scores, with memory, though gains varied by model.
Table: Average reward by model on CL-Bench database tasks
Conditions: CL-Bench 1.0 database tasks using Claude Managed Agents. A new session per question; the directory persists when memory is enabled. Based on the original figure's alternative text.
Unit: Average reward
| Model | Without memory | With memory |
|---|---|---|
| Opus 5.5 | 0.655 | 0.838 |
| Sonnet 5.5 | 0.644 | 0.833 |
| Opus 5 | 0.564 | 0.828 |
| Opus 4.7 | 0.383 | 0.700 |
| Sonnet 5 | 0.306 | 0.610 |
| Sonnet 4.6 | 0.330 | 0.364 |
The company reported that Sonnet 4.6 gained little from memory alone, but reached 0.641 when told to read memory and test hypotheses before answering. Sonnet 5 read memory first nine times out of ten without extra instructions.
Anthropic says stronger models benefited more from deciding what mattered than from fixed rules about what to remember. Recording only failures reduced the performance gains from memory.
3. Good memories must be reusable, not just plentiful
The Pokémon Red experiment compared memories at about 10,000 steps in one run per model. The company reported that Fable 5, which kept strategies and next steps, earned more badges with fewer files than Sonnet 3.7, which kept detailed logs.
Table: Memory size and game progress in the Pokémon experiment
Conditions: One run per model, compared at about 10,000 steps. The Fable 5 file count includes top-level files.
| Model | Files | Folders | Badges |
|---|---|---|---|
| Sonnet 3.7 | 413 | 225 | 1 |
| Fable 5 | 10 | 2 | 4 |
From around step 10,000, Sonnet 3.7 spent 17 steps creating six files and deleting nine without acting in the game. This suggests that saving strategies for the next action is more useful than saving state that can be checked onscreen.
4. Dreaming fixes errors and maps paths to needed memories
In the Pokémon experiment, Anthropic showed dreaming correcting a note about a healing facility's location near a mountain entrance by checking logs. The run using the corrected memory returned to the mountain and reached the next town. The run retaining the error backtracked three times and never crossed the mountain.
A wiki links topic-based knowledge and notes into pages, mapping paths to needed memories. Anthropic evaluated 25 questions over about 350,000 internal documents totaling about 420 million tokens. As Opus 5 grew the wiki through dreaming, the company reported higher scores with wiki plus search than with the wiki alone.
Table: How rubric fulfillment rates changed as the wiki grew
Conditions: The same internal documents and 25 evaluation questions. Comparison after 2 and 128 dreaming sessions in which Opus 5 built the wiki.
Unit: %
| Sources used for answers | After 2 sessions | After 128 sessions |
|---|---|---|
| Search only | 53 | 53 |
| Wiki only | 13 | 48 |
| Wiki and search | 54 | 61 |
The company reported that combining the wiki and search also saved about 20,000 tokens per question. Among 24 questions on merger materials, those requiring multiple documents scored 87% with a wiki versus 73% with search alone.
5. Memory quality consumes both compute and storage
Some search savings shift to memory maintenance compute and storage. The company reported that, in one legal task, a wiki organizing 10 documents totaling 115KB grew to 68 pages, 255 links, and 203KB. Dreaming also uses compute, and context loaded into the next session consumes tokens.
Wikis offered no clear advantage in legal tasks where answers could be found directly in a single document. Loading incorrect notes every time can also repeat errors.
Anthropic keeps top-level memory small and uses links to find details. Claude Code likewise loads only the first 200 lines or 25KB of MEMORY.md, using it as an index, a list for quickly locating content.
Developers can consider adjusting when dreaming occurs based on how often information changes or is accessed.
The key to agent memory is not storing more, but verifying logs and organizing them into layers suited to the next task.
