Claude agents 'dream' between sessions to clean up their notes
Anthropic's dreaming lets Claude reread past sessions, fix wrong memory notes and build wikis. What the evaluations showed, how dream jobs work in Managed Agents (research preview, access on request), and what they cost.
Updated November 20, 2026: Expanded with evaluation results, API setup, costs and limits.
In a November 6 engineering post, Anthropic described dreaming: an offline pass where Claude rereads its past session transcripts, checks the notes it saved to memory against what actually happened, fixes mistakes and reorganises what it knows. The idea builds on sleep-time compute, proposed by researchers at Letta and UC Berkeley as a way for models to use idle time between interactions to rework their context. In Claude Managed Agents, dreams are a research preview you have to request access to; you start each one as a job.
Why agent memory needs a cleanup pass
Agents write memory notes in the moment, based on what looks important during a session. The post points out the flaw: a note that is wrong from the start, or goes stale as things change, can be read and trusted in a later session. Over many sessions a memory store also collects duplicates and contradictions. Dreaming uses the transcripts as ground truth to correct that.
Anthropic's clearest example comes from Claude playing Pokemon Red. Claude noted the wrong side of a mountain for a landmark, walked off a one-way ledge, and with the uncorrected note never reached the next city. After a dream checked the note against the transcript and rewrote it, Claude went back into the cave and got through.
What the evaluations showed
- Wikis built by dreaming: on about 350,000 internal files (roughly 420M tokens) from Stainless, a company Anthropic acquired in May, Opus 5 agents built a linked wiki over 128 sessions. On 25 test questions, answering from the wiki alone rose from 13% to 48% of graded criteria as dreaming scaled from two sessions to 128.
- Wiki plus search: with both, the score rose from 54% to 61% as the wiki grew, against 53% for search alone, and it saved about 20,000 tokens per question.
- Cross-document questions: in a 24-question merger test, on the subset that needed several files, judgement or calculation, Claude scored 87% with the wiki versus 73% with search alone.
- Goal-focused instructions: on a contract task, a wiki built with generic instructions kept 41 of 57 graded facts. After Claude rewrote the instructions so each contract got its own page with terms quoted exactly, all 57 survived.
The post is candid about the misses. On a legal-brief task where most answers sat in a single document, the wiki gave no clear gain over search. On another, the wiki grew larger than the source documents and abstracted nothing.
Anthropic also found that stronger models do better when told what memory is for rather than how to use it. Telling Opus 5 and Opus 4.7 to record only failures cost them much of their memory gain. Steering helped older models most: prompting Sonnet 4.6 to read its memory files before answering and then to test its theories explicitly nearly doubled its score. Unprompted, Sonnet 5 read its memory first 9 times out of 10; Sonnet 4.6 did so less than half the time.
How dreams work in Managed Agents
In the API, a dream is an asynchronous job. You give it a memory store plus 1 to 100 past sessions (if you have no store yet, create an empty one first), and it produces a new output store with duplicates merged, stale or contradicted entries replaced by the latest value, and new insights added. The input store is never modified, so you can review the result and throw it away. Jobs typically take minutes to a few hours, depending on how many transcripts you feed in.
The Python SDK call from the docs looks like this:
dream = client.beta.dreams.create(
inputs=[
{"type": "memory_store", "memory_store_id": store_id},
{"type": "sessions", "session_ids": [session_a, session_b]},
],
model="claude-opus-5-5",
instructions="Focus on coding-style preferences; ignore one-off debugging notes.",
)You poll the dream until it is completed, then attach the output store to future sessions in place of, or alongside, the old one. If a dream fails or is canceled, the output store keeps whatever was written so far. While it runs, its session_id points to an underlying session whose events you can stream. The optional instructions steer the overall synthesis; the docs say line-level commands such as "change sentence X to Y" generally do nothing, and targeted edits belong in the Memory Stores API.
Access, cost and limits
- Research preview, Claude API only. You request access through Anthropic's Managed Agents form, and calls need the dreaming-2026-04-21 beta header in addition to managed-agents-2026-04-01.
- Supported models include Fable 5.2, Opus 5.5 and Sonnet 5.5, plus earlier Fable, Opus and Sonnet versions listed in the docs.
- Billing is at standard token rates for the model you pick, and cost scales roughly linearly with the number and length of input sessions. The docs suggest starting with a small batch.
- Not eligible for zero data retention (except self-hosted Managed Agents) or HIPAA. Session transcripts persist until you delete them.
Who it is for
It fits any Managed Agents deployment whose memory store keeps growing across sessions. For more control, Anthropic's cookbook has a recipe for building your own dream with your own prompts, models and schedule.
Our take
The interesting part is not the wiki scores but the admission that memory written in the moment is often wrong, and that rereading transcripts fixes it. Anthropic itself notes dreaming costs compute and works best focused on information likely to change. If you have access, run one dream on a small batch of sessions, review the output store in the Console or through the Memory Stores API, and only then decide whether to replace the old store or run both.
Source: The components of agent memory (Anthropic), Dreams (Claude Platform Docs)
This story first appeared in the claudefox daily briefing for November 10, 2026.