
AI agents may need something like sleep to turn experience into useful memory. In a new account of its work on Claude, Anthropic describes a process it calls “dreaming”: models revisit past interaction logs during idle periods, check what they learned, correct errors and organize information for future tasks.
The approach borrows from a theory of human memory. The brain records experiences as they happen, while later replay during sleep and quiet rest is thought to help consolidate some of them into longer-term knowledge. Anthropic’s researchers say AI agents can follow a similar pattern, saving notes during work and refining them afterward.
Now loading...
That division addresses a difficult problem for agents: deciding what will matter later. A memory note is not just a record of the past, the researchers argue. It’s also a bet that a fact, strategy or lesson will be useful in a future session. In tests, newer Claude models increasingly used mistakes and feedback to form practical rules for subsequent tasks.
On a long-horizon database benchmark, agents began each question in a fresh session but could consult a shared memory folder. Earlier models tended to leave scattered, untested hypotheses. More capable versions began assembling verified facts, correcting wrong answers and recording why a rule was reliable. Anthropic says Opus 5 was the first model in its comparison to consistently complete that learning loop; Opus 5.5 and Sonnet 5.5 also did so.
A Pokémon Red experiment showed why more memory is not necessarily better. After roughly 10,000 steps, Sonnet 3.7 had produced 413 files across 225 folders, recording individual encounters, items and characters. It had earned one badge. Fable 5 had written nine files in two folders, along with a central overview, and earned four badges.
The older model’s detailed archive included information that could be read from the game screen and quickly became outdated. It also spent turns managing its notes instead of playing. Fable 5 focused on information the game would not supply directly, such as plans, navigation strategies and tested rules. One note captured a lesson from repeated failed attempts to catch a Magikarp: vary the timing between menu actions. Opus 5.5 used a similarly compact set of notes to track its goals and progress through the game.
Anthropic found that broad guidance often worked better than rigid instructions about what to save. On the database benchmark, telling stronger models to record only failures reduced much of the benefit they got from memory. Older models did benefit from more direction: prompting Sonnet 4.6 to read its notes and test its theories nearly doubled its score, the company said.
Dreaming can also catch bad information before it spreads. In one Pokémon run, Claude misidentified which side of Mt. Moon held a Pokémon Center, then used that mistaken landmark to navigate. The error sent it repeatedly over a one-way ledge. When an offline pass compared the memory note with the original transcript, Claude found and corrected the mistake. With the revised note, it crossed the cave and reached Cerulean City.
Another use is building a structured knowledge base, or wiki, from a large collection of documents. Anthropic tested the idea on about 350,000 internal files from Stainless, a software company it acquired in May. Across 128 sessions, Claude agents created and revised linked pages. On a 25-question evaluation, performance rose from 13 percent to 48 percent of the grading criteria as the wiki developed.
The wiki proved most useful when paired with search. On questions about the document collection, the combination raised Claude’s score from 53 percent with search alone to 61 percent, while saving about 20,000 tokens per question. In a separate merger-document test, the wiki helped answer questions requiring facts scattered across multiple files: Claude scored 87 percent on those questions, compared with 73 percent using search alone. It offered little advantage when the answer could be found in a single document, and in one test the wiki grew larger than the source material.
The researchers also found that a wiki’s organization must reflect the task. In one legal brief exercise, agents put contract terms into a shared table that omitted information and suffered from agents overwriting one another’s work. The resulting brief met 72 percent of the grading criteria. After Claude revised its instructions so each contract received its own page and its terms were quoted directly, the brief met all the criteria.
Keeping the most useful notes readily available requires restraint. Memories loaded automatically at the start of a session consume context and can repeatedly expose a model to incorrect information. Anthropic says the top layer should remain small, with links directing Claude to deeper material when needed. Claude Code, for example, loads only the opening 200 lines or 25 kilobytes of its memory file as an index.
Anthropic says key design questions remain, including when agents should write notes, how often they should review them and how to keep memory current as circumstances change. Searching old transcripts may help, but maintained structures such as wikis also require compute and can accumulate errors. For now, the company’s experiments suggest that useful agent memory depends not on saving everything, but on selecting, checking and reorganizing the parts most likely to help later.
