# What is Claude dreaming? How agents clean up their own memory

> Anthropic's offline memory step reads past sessions and rewrites an agent's notes. Here is how it works, what the tests showed and how to try it.

URL: https://claudegpt.si/news/claude-dreaming-agent-memory  
Published: 2026-11-07T18:51:39.887Z  
Author: ClaudeGPT Si Newsroom  
Section: Research  
Topics: Anthropic, Claude, AI agents, Agent memory  
Publisher: ClaudeGPT Si

## Key takeaways

- Dreaming is an asynchronous job that reads a memory store and 1 to 100 past sessions and writes a new, cleaned-up store, leaving the input untouched.
- Anthropic reports memory lifted Opus 5.5 from 0.655 to 0.838 on CL-Bench, with several results from single runs or small question sets.
- Dreams are a research preview on the Claude API, billed at standard token rates, and not eligible for zero data retention.

Claude dreaming is an offline step in which Claude reads an agent's past session transcripts and rewrites its memory: it merges duplicates, fixes stale or wrong notes and adds new ones. Anthropic describes it in an [engineering post on the components of agent memory](https://www.anthropic.com/research/components-of-agent-memory) published on November 6, 2026, and documents the API in its [Managed Agents docs](https://platform.claude.com/docs/en/managed-agents/dreams).

The idea is simple. An agent that writes notes as it works ends up with a messy notebook. Dreaming is the cleanup pass, run between sessions instead of in the middle of a task. Anthropic compares it to the way the brain replays the day during sleep and keeps what matters.

## What dreaming does

In the API, a dream is an asynchronous job. You give it an existing memory store and 1 to 100 past sessions. It reads both and writes a new, separate memory store. The input store is never changed, so you can review the result and throw it away. According to the docs, a dream typically takes minutes to a few hours, depending on how many transcripts it reads.

You can pass optional `instructions` to steer it, such as "focus on coding-style preferences". The docs say this works for broad guidance, not line edits: telling it to change a specific sentence generally changes nothing.

## The four layers of agent memory

Anthropic's post defines agent memory as knowledge Claude gains from experience and keeps between sessions. It leaves out changes to model weights, learning inside one conversation, and compaction. It splits memory into four layers:

1. **Transcripts:** a searchable log of what happened.
2. **Memory notes:** observations Claude writes during or after work.
3. **Memory representations:** structures built from notes, such as linked wikis.
4. **Injected context:** what gets loaded at the start of every session.

Dreaming can move information between any two of these layers.

## What Anthropic measured

All numbers below are Anthropic's own, from its post.

On CL-Bench, a database task where the agent writes memories to help on later questions, mean reward rose for every model tested. Opus 5.5 went from 0.655 to 0.838 with memory, and Sonnet 5.5 from 0.644 to 0.833. Sonnet 4.6 barely moved, from 0.330 to 0.364. Anthropic found that prompting it to read and test its memory roughly doubled its score, to 0.641.

Telling a stronger model what memory is for worked better than giving it rules. Restricting Opus 5 to "record only failures" cut its memory gain by 0.234.

In a Pokémon Red test, Claude Sonnet 3.7 wrote 413 memory files and earned one badge. Claude Fable 5 wrote 10 files, kept to things the game doesn't show on screen, and earned four. Each comparison was a single run.

Dreaming also fixed errors. A wrong note about a Pokémon Center led Claude off a one-way ledge three times. After a dream checked the note against the transcript and corrected it, Claude got past the mountain. The run with the uncorrected note never did.

On a corpus of about 350,000 files, dreaming built a wiki over 128 sessions, growing from 103 pages to 222. A wiki alone answered 13% to 48% of graded criteria. A wiki plus search scored 54% to 61%, against 53% for search alone, and saved about 20,000 tokens per question. On 24 merger questions that needed several documents, the wiki scored 87% against 73% for search.

## Where it falls short

Anthropic lists the limits itself. Several results come from one run. The question sets are small, 24 and 25 questions. On a task where the answer sat in a single document, the wiki gave no clear gain, and one wiki was 1.77 times the size of its source. A wrong note promoted into injected context spreads to every session. Dreaming also costs compute, so re-checking everything all the time may not be practical.

Instructions matter too. When several agents wrote to one shared table of contract terms, overwrites left 41 of 57 facts. Giving each contract its own page kept all 57.

## How to try dreaming

Dreams are a research preview on the Claude API, behind the `dreaming-2026-04-21` beta header, and access is by request. They work with Claude Fable 5.1, Fable 5, Opus 5.5, Opus 5, Sonnet 5.5, Sonnet 5, Opus 4.8, Opus 4.7 and Sonnet 4.6. They are billed at standard token rates for the model you pick, and cost grows roughly in line with the number and length of sessions. The docs advise starting with a small batch. Dreams are not eligible for zero data retention or HIPAA, because session transcripts persist until you delete them.

If you only want the behavior without the API, the Claude Cookbook has a recipe for building your own dream with prompts and models you choose.

For the memory features inside Claude's apps, see our guide to [how Claude's memory works](https://claudegpt.si/news/memory-tax-agent-memory-paper) and our explainer on [what an AI agent is](https://claudegpt.si/news/what-is-an-ai-agent).

## Frequently asked questions

### What is Claude dreaming?

It is an offline process in which Claude reviews an agent's past session transcripts and its memory store, then writes a reorganized store with duplicates merged and stale entries fixed.

### Does dreaming change my existing memory store?

No. The docs say the input store is never modified. The dream writes a separate output store that you can attach to future sessions or discard.

### How much does Claude dreaming cost?

Dreams are billed at standard API token rates for the model you choose, and cost scales roughly with the number and length of the input sessions.

### Is dreaming available to everyone?

Not yet. It is a research preview on the Claude API behind a beta header, and access is requested through a form.

## Sources

- [The components of agent memory](https://www.anthropic.com/research/components-of-agent-memory), Anthropic
- [Dreams (Managed Agents docs)](https://platform.claude.com/docs/en/managed-agents/dreams), Anthropic
