Anthropic published a post on how it designs memory for Claude, framed by Kierkegaard's line that life can only be understood backward but must be lived forward. Its subject is "dreaming": using idle time between sessions to reflect on logs, correct mistakes and organize notes, an idea it ties to the hippocampus replaying experience during sleep and to Letta and UC Berkeley's proposal of sleep-time compute. By "agent memory," Anthropic means knowledge Claude gains from experience and retains between sessions as context it can read later, not changes to weights, in-context learning or compaction. The post links cookbooks for getting started with dreaming and knowledge wikis.
Models have learned to judge what matters
Memory is, in Anthropic's framing, a prediction that a rule will be needed again. On Continual Learning Bench (CL-Bench) 1.0, where Claude answers database questions in fresh sessions with a persistent memory directory and learns the correct answer afterward, models differed in how far they built a learning loop:
- Claude Sonnet 4.6: generated theories about wrong answers, in scattered files of untested guesses.
- Claude Opus 4.7: consolidated notes into one reference and marked which facts were checked.
- Claude Sonnet 5: marked answers as confirmed after grading and wrote corrections.
- Claude Opus 5: the first to close the loop, with entries holding a rule, how it knew the rule was true, earlier answers and warnings about traps. Claude Opus 5.5 and Sonnet 5.5 also close it, scoring about the same as Opus 5 with memory, from slightly higher baselines without it.
In Pokémon Red, Anthropic compared memory folders at about 10,000 steps. Claude Sonnet 3.7 wrote everything: 413 files across 225 folders, a file per battle, item and character, and earned one badge. Its record kept going stale, and around step 10,000 it created six files, deleted nine and took no game actions over 17 steps. Claude Fable 5 wrote nine files in two folders plus a global.md dashboard holding its goal, a gym plan and its own memory rules, skipping facts readable on screen, and earned four badges. Opus 5.5 also kept a small, rewritten folder and beat the game.
Steering, lightly
Telling Claude what memory is for helped, but prescribing how did not. On CL-Bench, simply saying a memory folder was available was enough for Opus 4.7 and Opus 5 to benefit. Fixed rules such as "record only failures" cost both models much of their memory gain. Steering helped older models most: prompting Sonnet 4.6 to read its memory before answering and test its theories nearly doubled its score, while Sonnet 5 read memory first 9 times out of 10 unprompted, against under half the time for Sonnet 4.6. For frontier models, Anthropic leaves the judgment to Claude.
What dreaming does
- Corrects memory. In Pokémon, Claude had wrongly noted that the PokéCenter at Mt. Moon's entrance was on the east side, walked off a one-way ledge three times and, after the third, stopped before wandering back to Pewter City without reaching Cerulean City. When dreaming checked the note against the session transcript, it caught and rewrote the error, and the run went straight into the cave and on to Cerulean City.
- Builds wikis. Using about 350,000 files (about 420M tokens) from Stainless, a software company Anthropic acquired in May, and 25 questions, Opus 5 agents built a linked wiki over 128 sessions, merging duplicates and checking claims. Scores rose from 13% to 48% of graded criteria as sessions grew from 2 to 128. With search plus the wiki the score rose from 54% to 61% as the wiki grew, against 53% for search alone, and saved about 20,000 tokens per question. On 24 questions about a merger, wiki answers scored 87% on the harder multi-document items against 73% for search. On a Harvey LAB task with criteria findable in one document the wiki gave no clear gain, and on another it grew larger than the documents, which Anthropic compares to Borges's map as large as the empire.
- Promotes notes. Dreaming can float key notes to a top layer the harness loads into every session, which must stay small because injected notes use tokens, a wrong note travels into every session and longer instruction files reduce adherence. Claude Code's auto memory loads only the first 200 lines or 25 KB of MEMORY.md, as an index.
- Focuses on a goal. On a LAB acquisition task, a first wiki missed contract terms because agents overwrote a shared table, and a brief from it included 41 of 57 facts (72%). After a loop where Claude reflected on failures and rewrote the build instructions, each contract got its own page quoting terms word for word, and the brief met 100% of the criteria. An assistant such as Claude Duet could tune dreaming to organize around the person it helps.
- Fills gaps across sessions. A second pass found nine links to a missing page and repointed them, and added three pages including an index.
Open questions
Anthropic says it has not settled when memory should be created, since writing notes mid-task distracts from the task while dreaming runs in the background but is not immediately available. It also asks how to keep memory current, since dreaming needs compute and may need to focus on information likely to change, and whether transcript search should be the foundation, with wikis needing maintenance so they do not accumulate errors. No model can know what the next turn will bring, so dreaming is a chance to look backward and organize.