Anthropic’s note on agent memory separates transcripts, notes, wikis and a pass it calls dreaming
The Friday engineering post, by Lance Martin, defines memory as files Claude can read later, not a change to the weights. On a corpus of about 350,000 files, scaling that offline pass from two sessions to 128 lifted a wiki-only score from 13% to 48%. A wiki plus search saved about 20,000 tokens a question. Claude Code still injects only the first 200 lines, or 25 KB, of MEMORY.md.
Feature5 minIn-depth
James Okonkwo5 min read
- Anthropic
- Claude
- Agents
- Memory

Photo: AnthropicSource page
Anthropic on Friday published an engineering account of how Claude keeps what it has learned between sessions. The post is dated 6 November. Lance Martin wrote it, on the engineering team. The definition is narrow. Agent memory, the post says, is knowledge Claude gains from experience, including user interactions and assigned tasks, and keeps as context it can read later. It is not a change to the model’s weights, not learning inside a single conversation, and not the summaries Claude writes when it compacts an old thread to keep going.
The post’s working picture has four pieces. Session logs, which it also calls transcripts, are the record of what happened. Notes are files Claude writes when it decides something is worth keeping. Wikis are linked pages it builds later, as a map over those notes and over source documents. Injected context is the short slice loaded into every new session so Claude does not have to go looking. A background pass over the logs, which the post calls dreaming, is how Claude corrects notes, builds the wiki, and decides what belongs in that top slice. Anthropic credits the idle-time idea to researchers at Letta and at UC Berkeley, who proposed sleep-time compute as a way for a model to reorganize context between turns.
What gets written down
The post treats a note as a prediction: a rule written now is a bet that a later session will want it. On a database task from Continual Learning Bench 1.0, Claude started each question in a fresh session and could read a memory folder that survived from the last one. After each answer it was told the correct solution. Anthropic says the models did not use that folder the same way. Sonnet 4.6 produced files of untested guesses. Opus 4.7 kept one reference document and marked which facts it had checked. Sonnet 5 marked an answer confirmed once the grader had checked it, and wrote a correction when it was wrong. Opus 5, the post says, was the first of these to close the loop: a rule, how it knew the rule was true, earlier answers, and warnings about traps. Opus 5.5 and Sonnet 5.5 also closed it. With memory, Anthropic says, both scored about the same as Opus 5, though their scores without memory were slightly higher. The post does not print those scores.
A second comparison is one run each of Pokémon, used as a test of what the model bothers to save. At about 10,000 steps, Sonnet 3.7 had written 413 memory files across 225 folders and had earned one badge. Fable 5 had written nine files in two folders, plus a top-level file called global.md, and had earned four badges. Anthropic’s reading is that Sonnet 3.7 stored facts the screen already showed, such as money and map position, and that those notes went stale. Around step 10,000 it spent 17 steps creating six files and deleting nine, and took no actions in the game. Fable 5’s global.md held the current goal, a plan for the gyms, and the model’s own rules for memory. After seven Poké Balls failed to catch a Magikarp, it wrote a rule about changing the timing. Opus 5.5, the post says, kept a small folder of the current goal and the next steps, rewrote it as it played, and beat the game.
Prompting changed the older models more than the newer ones. Told only that a memory folder existed, Opus 4.7 and Opus 5 used it and gained from it. A rule to record only failures cost both of them much of that gain. Sonnet 4.6 often did not read its files. Told to read them before answering, and to test its theories, its score on the database task nearly doubled. Sonnet 5 read its memory before answering 9 times out of 10 without that instruction. Sonnet 4.6 did so less than half the time. Anthropic says that on frontier Claude models it now gives a short instruction to write a note when a person asks, or when something is clearly worth remembering, and leaves the judgment to the model.
Dreaming, and what gets loaded next time
Dreaming is the pass that checks notes against the transcript. In one Pokémon run the note put a landmark on the wrong side of a cave. Claude announced the cave was finished, walked off a one-way ledge, and decided it had merely gone too far west. Anthropic then ran dreaming on that folder. The model caught the error against the transcript and rewrote the note. With the correction, the post says, Claude went back into the cave and reached the next city. In the run that kept the bad note, it fell back onto the earlier route three times and never reached that city. A run with no memory did not either.
The largest measurement is a wiki built over internal documents from Stainless, a software company Anthropic says it acquired in May: about 350,000 files, roughly 420 million tokens. Opus 5 agents, over 128 sessions and a shared log, explored the files, wrote and corrected linked pages, merged duplicates, and checked claims against the sources. On 25 questions, the score from the wiki alone rose from 13% of graded criteria after two sessions to 48% after 128. With search as well as the wiki, the score rose from 54% to 61% as the wiki grew, against 53% for search alone. The wiki-only best was 48%. Using both, Anthropic says, saved about 20,000 tokens per question.
A second set, 24 questions about a merger in the Harvey LAB benchmark, scored 87% when Claude used the wiki and 73% with search alone. More than half of those questions needed more than one document. On a different LAB task, where most criteria could be met from a single document, the wiki showed no clear gain. On another, the wiki grew larger than the files it was summarizing.
A contract task showed a writing collision. Several agents wrote contract terms into one shared table. A brief graded from that wiki included 41 of 57 facts, 72%. Anthropic says a loop that let Claude rewrite the wiki instructions then gave each contract its own page, written by one agent, quoting the terms. A brief from that wiki met 100% of the criteria. The top of the stack stays small on purpose. Anthropic says an injected note costs tokens in every session, a wrong note is repeated in every session, and loading a note does not mean Claude follows it. Claude Code’s auto memory, the post says, loads only the first 200 lines or 25 KB of MEMORY.md. That header is an index. The rest is read when Claude asks for it.
The post’s open questions are about when to write the note, during the task or afterward, and how often to spend the compute to recheck a store that can go stale. It does not announce a new product setting.


