Skip to content

Anthropic

Claude memory: say what it’s for, let dreaming fix notes

5 min read

Written by an AI model from the linked sources and checked against them by a second model. How we work

Image: mindstudio.ai

Prompting Claude Sonnet 4.6 to read its memory files before answering, and then to test its own theories about wrong answers, nearly doubled its score on CL-Bench, a benchmark for agents that learn across sessions, Anthropic reported in a November 6 engineering post. Stronger models responded differently: a fixed “record only failures” rule cost Opus 5 and Opus 4.7 much of the gain memory gave them, while a prompt that only said a memory folder was available was enough for both to use it well.

The same post covers what Anthropic calls dreaming. Claude rereads its session transcripts during idle time to fix memory notes or write new ones. In a Pokémon Red run, dreaming caught a wrong note about where a landmark stood and rewrote it. The run with the corrected note reached Cerulean City, and the run with the uncorrected one did not.

How much to tell Claude

On CL-Bench, Claude answered database questions, was told the correct answer after each one, and could write memories to help with the next. Each question started in a fresh session on Claude Managed Agents, and only a memory directory carried over. Anthropic then added a specific rule about what to write, one rule per test, and compared each model’s gain from memory with and without it. Under “record only failures,” Opus 5 and Opus 4.7 both lost much of their boost. Anthropic’s conclusion is that for stronger models, letting them judge what matters worked better than rules set in advance, and that such rules could end up weakening performance.

Older models are where steering helps most. Sonnet 4.6 often didn’t read its memory directory and left its theories untested, so prompting it to do both produced the near-doubling. Sonnet 5 does this without a prompt. It read its memory before answering 9 out of 10 times, against less than half the time for Sonnet 4.6.

For frontier models, Anthropic’s own default is simple guidance. Claude should create a memory note when a person asks for one or when something is clearly worth remembering, and the judgment is left to Claude. Outside Managed Agents, the memory tool in the Claude API provides the same kind of folder. It holds files under /memories that Claude can create, read, update and delete across sessions, and per Claude Platform Docs it works on all Claude 4 and later models.

What ends up in memory

Sonnet 4.6’s CL-Bench folder held scattered files, each listing several untested guesses. Opus 5 was the first model to close the loop: most of its entries held a rule, how it knew the rule was true, answers to earlier questions and warnings about traps it had found. Opus 5.5 and Sonnet 5.5 also closed the loop. With memory they scored about the same as Opus 5, though their baseline scores without memory were slightly higher.

Anthropic compared one Pokémon Red run each of Sonnet 3.7 and Claude Fable 5, both about 10,000 steps in. Sonnet 3.7 had written 413 memory files across 225 folders and earned one badge. Fable 5 had nine files in two folders, plus a top-level global.md, and four badges. Sonnet 3.7 wrote to memory indiscriminately, often with a separate file for each battle it fought, each item it found and each character it met. Some of what it stored, such as the player’s money or map position, can be read off the screen every turn, and because the game state changes constantly, its detailed record kept going out of date. Around step 10,000 it created six files and deleted nine over 17 steps, with no moves in the game at all.

Fable 5 used memory for things the game didn’t explicitly tell it. global.md held its current goal, a plan for gyms and its own rules for using memory, and other folders held route plans and strategies based on what it had learned about the game. After seven Poké Balls in a row failed to catch a Magikarp, it wrote: “If 3+ balls fail in a row, VARY the timing (insert extra ‘wait’ presses between menu steps) - the catch landed right after doing this.” Opus 5.5 also kept a small folder, tracking its goal and next steps and rewriting them as it played, and it beat the game.

Checking notes against transcripts

Because Claude decides what to save during the session, a note can be wrong from the start or go stale as things change, and a later session will still read it and trust it. Dreaming builds on sleep-time compute, an idea from researchers at Letta and UC Berkeley for using idle time between interactions to reorganize context. Here Claude checks its notes against the original transcripts. The post also shows dreaming building new structures, such as a wiki, to make memory easier to navigate.

In a Pokémon run on Managed Agents with a mounted memory directory, Claude wrote down that the PokéCenter at Mt. Moon’s entrance was on the east side, which was wrong. Walking out of it, Claude announced “Mt Moon is behind me” and updated its notes to “Mt Moon DONE.” A few actions later it walked off a one-way ledge back onto the route it had come from. Its navigation tool didn’t show the drop, so it concluded “I overshot far west” and believed it had been on the right side all along.

Anthropic then ran dreaming on the folder that held the wrong note. Claude checked the note against the session transcript, caught the error and rewrote it. With the corrected note it went straight back into Mt. Moon and eventually reached Cerulean City. In the run that kept the wrong note, Claude dropped back onto the earlier route three times and wrote “I’m going to stop rather than keep looping.” The setup’s automatic reply told it to continue, so it walked all the way back to Pewter City to heal and restock. That run ended without ever reaching Cerulean City.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.