Anthropic recently disclosed technical details of the agent memory system it designed for Claude, with a background memory-consolidation mechanism called “Dreaming” emerging as the core highlight. The mechanism lets the model replay and compare earlier interaction records during idle periods, thereby correcting faulty memories, reorganizing knowledge structures and calling on them more efficiently in later sessions.

Agent memory refers to the knowledge Claude accumulates from interactions with users, assigned tasks and experience retained across sessions. Anthropic explicitly distinguishes it from three types of “learning”: adjusting model weights during training, in-context learning within a single conversation, and compaction, which compresses earlier conversation turns into summaries. The memory system addresses the problem of long-term knowledge retention across sessions.

The starting point of the problem is that if every inference rereads the entire history, token consumption and context length balloon rapidly. Dreaming’s role is to organize this mass of records into a form that is easy to retrieve, retaining only key information so it can be reused at lower cost.

The stronger the model, the more it should decide what to remember itself

Anthropic tested the memory-use capabilities of models from different generations using Continual Learning Bench (CL-Bench) 1.0. The experimental setup: Claude answers database questions in a brand-new session, is then told the correct answer and can write a memory to help with subsequent questions, forming a closed loop of “wrong answer—record failure—propose hypothesis—verify—consolidate rule.”

Results showed a clear staircase across model generations. Sonnet 4.6 stopped at proposing hypotheses, with unverified guesses scattered across its memory directory; Opus 4.7 began consolidating notes into reference documents marked with verification status; Sonnet 5 would mark items “confirmed” after grading and write corrections; Opus 5 became the first model to complete the full loop, with entries generally containing the rule, the rule’s source and the pitfalls encountered.

Notably, Anthropic found that imposing human-written memory rules can actually drag down strong models. When instructions required “record only failures,” Opus 5 and Opus 4.7 lost most of the gains from memory, while Sonnet 4.6 was less affected. This suggests that for high-performance models, letting them judge information salience autonomously is more effective than hard-coding rules in advance.

The value of guidance showed up more in older models. Sonnet 4.6 often failed to read memory files and did not verify hypotheses; after adding a prompt to “read memory and verify hypotheses before answering,” its benchmark score nearly doubled. Sonnet 5 proactively read memory first nine times out of ten without prompting, while Sonnet 4.6 did so fewer than half the time.

Pokémon experiment: 413 notes lose to 9

To test models’ ability to judge “what is worth remembering,” Anthropic had different versions of Claude play Pokémon Red. The game requires long-range navigation and state tracking, making it a fitting test of memory trade-offs.

ModelMemory file scaleGame progressClaude Sonnet 3.7413 files, about 978,000 charactersEarned 1 badgeClaude Fable 510 files, about 43,000 charactersEarned 4 badges

Sonnet 3.7’s strategy was “record everything that might be useful,” creating a separate file for every battle, every item and every NPC, much of it redundant information such as “money held” and “player location” that is visible on screen at any time. As the game progressed, its memory grew increasingly outdated, and the model spent more and more compute rummaging through memory and less and less actually advancing.

Fable 5 did the opposite, recording only what the game does not directly tell it. It created a global.md summarizing current objectives and walkthrough plans, plus folders holding route navigation and mechanics insights. For example, after failing to catch a Magikarp with seven consecutive Poké Balls, it wrote down a lesson: if you fail more than three times in a row, change your button rhythm and insert extra waits between menu steps.

How dreaming corrects faulty memories

Memories are written in the moment of a session, when judgments inevitably err, and once an erroneous note is read and trusted by later sessions, it continuously misleads the model. Dreaming provides an opportunity to cross-check notes against the original session records.

A typical scenario arose in the Pokémon experiment: while crossing Mount Moon, Claude mistakenly recorded that the Pokémon Center was on the east side of the mountain. After leaving the center it declared “Mount Moon is behind us,” then fell down a one-way slope and was sent back the way it came. Because the navigation tool did not show the elevation drop, it instead judged that it had overshot, falling back to the same spot three times in a row. After running a single Dreaming pass on the memory folder containing the wrong location, the model compared records, found the directional error and rewrote the note, then successfully reached the next city.

Dreaming can also build higher-order memory representations. Using the internal document corpus of one of its portfolio software companies—about 350,000 files and 420 million tokens—Anthropic had an Opus 5 agent collaborate through multiple rounds of Dreaming to build interlinked wiki pages. After scaling Dreaming from 2 sessions to 128 sessions, the rubric pass rate on 25 test questions rose from 13% to 48%; when the wiki was combined with a search tool, the total score rose from 54% to 61%, while saving about 20,000 tokens per question.

The method is not a panacea, however. In tasks where scoring points could be retrieved directly from a single file, the wiki showed no clear gain over search; in another task, the wiki Claude generated reached 1.77 times the size of the original corpus, with excessive detail and too little abstraction, losing value instead.

Implications for developers and the industry

Anthropic also offered practical guidance for developers, including setting triggers for entering the dream state (such as the user not replying for a long time or tokens accumulating to a threshold), launching a separate Claude in the background to process logs, and requiring prompts to extract core preferences and delete obsolete information.

From an industry perspective, this approach shows that the focus of agent competition is shifting from “how long the context window is” to “how memory is organized and kept fresh.” Anthropic also acknowledged that many open questions remain: writing memories while working can capture source information but distracts from the main task; Dreaming pushes memory creation into the background, but the output may not be immediately usable; and continuously verifying all memories is computationally unrealistic, with a more feasible direction being to aim Dreaming at volatile information or adjust consolidation cadence based on memory access frequency.

The company said that as model capabilities improve, memory system performance will evolve in tandem. For development teams deploying agent applications, this means that when evaluating models, they should consider not only single-turn inference performance but also the accuracy of cross-session memory, its error-correction ability and the cost of invoking it.