Anthropic has published a full account of the memory system behind Claude's agents: the model uses idle compute between interactions to "dream" — replaying and reorganizing its session history to fix mistakes and consolidate experience, turning cross-session long-term memory into an explicit engineering architecture. Chinese tech account AI Hanwuji's write-up of the announcement walks through the benchmarks behind it.

Concept illustration of Claude agent memory architecture
Concept illustration of Claude's layered agent memory and dreaming

The design builds on "sleep-time compute," a concept proposed earlier by Letta and UC Berkeley, and mirrors how the human brain handles memory: raw interaction logs are kept as records, key observations are written into memory notes, distilled into memory representations, and injected into context on demand, with dreaming operating across all layers. Anthropic draws a clear boundary: this memory means plain-text experience that persists across sessions — not weight updates, not in-context learning within a single conversation, and not summary-based context replacement.

Note-taking discipline is what separates the models. In the CL-Bench 1.0 database task, Claude Sonnet 4.6 produced only scattered, unverified guesses; Opus 4.7 began consolidating notes into a single reference document that separated confirmed facts from speculation; Sonnet 5 wrote errata whenever the judge marked an answer wrong; and Opus 5 became the first model to complete the full record-verify-correct learning loop, annotating how each rule was proven along with its own past failures. Opus 5.5 and Sonnet 5.5 then ran the loop autonomously, scoring above 0.83 on accumulated experience.

The Pokémon Red experiment makes the gap concrete. Over 10,000 steps, Sonnet 3.7 treated everything as important — 413 files and 977,000 characters of notes — and at one point spent 17 consecutive actions reorganizing its folder without moving in the game, finishing with a single gym badge. Claude Fable 5, by contrast, kept 9 files and 43,000 characters: it stored no on-screen values at all, only derived patterns, long-term plans and strategy — after 7 straight failed Poké Ball throws at a Magikarp, it wrote down "insert extra waits between menu presses after 3 consecutive failures" and caught the fish on the next attempt, taking 4 badges. Opus 5.5, holding one tiny task-plan file, beat the entire game. The rule experiments cut the other way: guided prompts lifted Sonnet 4.6's baseline score from 0.330 to 0.641, but forcing a rigid "only log failures" rule collapsed the memory gains of Opus 5 and Opus 4.7 by 0.234 and 0.150 — frontier models should keep the right to decide what matters.

Dreaming pays off at the moment of failure. In the Mt. Moon episode, Claude mis-recorded "the Pokémon Center is to the east," walked straight off the one-way ledge, and without dreaming gave up after three falls; the dreaming-enabled run replayed the raw logs offline, caught the contradiction, rewrote the note, and reached Cerulean City on step 1,935 of its next attempt. The enterprise numbers are just as striking: on Stainless (a company Anthropic acquired) and its real codebase of about 350,000 files and 420 million tokens, an Opus 5 agent answered 25 deep questions across 128 consecutive sessions while building a hypertext wiki in its sleep — pass rate on the wiki alone climbed from 13% to 48%, wiki-plus-search rose from 53% to 61% while saving about 20,000 retrieval tokens per question, and complex M&A-document Q&A hit 87% versus 73% for plain search. Wikis can also go rogue: a 115KB corpus of ten files was once turned into a 203KB, 68-page "giant wiki," 1.77 times the size of its source.

The other end of the architecture is restraint. Anthropic warns against stuffing memory into the context window — wrong notes poison every later decision — so the top layer holds only an omniscient index: Claude Code's automatic memory reads just the first 200 lines or 25KB of MEMORY.md at startup, leaving details to on-demand retrieval. Dreaming also edits in multi-agent settings: agents co-writing contract terms overwrote each other, losing 28% of 57 core facts; after a dreaming review the system rewrote its rules to per-contract pages with verbatim quotes, preserving all 57 facts, lifting the pass rate from 72% to 100%, and repairing 9 dead links along the way. What remains are engineering trade-offs: real-time note-taking splits the model's attention, while leaving everything to offline dreaming delays reuse — allocating dream cycles by how often a memory actually gets read is the next hard question.