Anthropic launches the “Dreaming” functionality to self-improve its AI agents. This asynchronous mode analyzes history to reorganize and reduce memory.
AI agents are getting organized. While OpenAI recently launched a Memory Consolidation feature within its Agents SDK, and Google had introduced persistent memory features with Vertex AI Memory Bank in July 2025, Anthropic recently integrated the “dreaming” feature into Claude Managed Agents.
Within this turnkey formula, which allows Claude users to create or deploy AI agents, the agent can now self-improve. For this purpose, it analyzes up to 100 past sessions. Objective: detect recurring patterns. To do this, this asynchronous process takes the AI’s long-term memory as input. He sorts, throws away duplicates and puts away. The goal is to let “Claude reflect on past sessions to organize an agent’s memory and bring out new information,” according to Dario Amodei’s company. This should produce a reorganized memory store.
Concretely, we provide the old conversation history to Claude with each new call. Claude processes the request and returns his response. The SDK, the code library provided by Anthropic to make it easier to write programs, then handles the technical complexity. It automatically compresses and summarizes history via specific headers. Objective: not to let it grow indefinitely. The result is a simplified history, ready to be reintroduced during the next call. Here is an example provided by Anthropic of Python code for creating a dream. Inputs to the dream include the pre-existing memory store and a session chart.
Python
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-4-8",
instructions="Focus on coding-style preferences; ignore one-off debugging notes.",
)
print(dream.id) # drm_01...
Note that it is possible to give instructions to guide the dream process. This feature is currently optimized for Claude Opus models (versions 4.8 and 4.7) and Claude Sonnet. Use of Dreaming mode is billed at standard API token rates, depending on the model chosen.
A limited opening
It might take a little patience to access the feature. Available as a research preview in Managed Agents, it requires going through the official Anthropic form. Access depends on Anthropic’s selection criteria. Make sure you already have an active Anthropic API account and a professional email address.
To find the UUID (Universally Unique Identifier) of the requested API organization, head to the Claude Console. Go to the bottom left of the interface, click on your name and copy the organization ID code. For our use cases, in the form, we click on the characteristic of the same name. Even if you don’t use it right away, you can click on “MCP Tunnels”. This will allow access to external tools in a secure manner. We then click on Python and Claude API CLI for “SDK and tools”.
Different uses of Dreaming mode in Claude Managed Agents
Dreaming Mode is ideal when agents keep making the same mistakes or need to assimilate lessons from numerous interactions. Claude explains that it is particularly suitable for workloads that require long-term execution or even cloud infrastructure. We have chosen three use case examples.
1. Prevention of repeated errors
Let’s imagine that an AI agent fails a large number of times to send a file that is too large by email. When switching to “Dreaming mode”, it identifies the model, for example “File > 25 MB + Email = Failure”. He finds a solution: “If the file is > 25MB, I have to first put it on a download link (like Google Drive or Dropbox) instead of attaching it directly.” For subsequent uploads with a large file, it directly creates a download link.
Technically, during Dreaming Mode, the model is loaded with two types of data. First, the session logs with the raw transcriptions of the failures. Then, a system directive asking it to extract “playbooks” from the errors. The template generates a new structured text file, often in Markdown or JSON. It contains the new rule. This is stored in a persistent Memory Store.
When a new task is performed, before the AI even begins to think, the harness, the testing framework that surrounds the agent to verify that it behaves correctly, retrieves these rules. He inserts them at the very beginning of the “System Prompt”. In this case, it sends this message to the model: “You are an email agent. Here are your learned rules: If file > 25 MB, use Google Drive. The user wants to send this 40 MB file.” The model now has this rule in its immediate context.
2. Consolidation of knowledge
Another example, an SME uses an AI agent to answer customer questions. Over the course of the week, the agent receives 50 different questions about a new update. Problem: Each time, the agent has to search through PDF manuals or ask a human how to respond specifically about the update. On weekends, the agent activates his Dreaming Mode. It analyzes the 50 conversations of the week concerning VAT. He writes a concise memory note which summarizes the exact procedure validated during the week.
Technically, triggering Dreaming Mode brings a scheduled task. For example, on weekends at midnight, a script is triggered automatically. Thanks to an instruction, Claude produces the playbook. This text produced by Claude is then written in a file or a database which constitutes the agent’s memory. When a customer asks a question, the answer is immediate.
3. Improved agent performance
Another case, an SME uses an AI agent to help maintain its server infrastructure. During a Dreaming Mode phase, the agent carries out a structural reorganization of its technical knowledge base. It detects obsolete instructions, archives old ones and marks new ones as “Priority Standard”. It removes unnecessary details from past debug logs to keep only the essentials. Result: the agent must respond faster and more precisely, and consume fewer tokens. The technical knowledge base also requires less maintenance.
In terms of limits, note that Dreaming mode can lead to the deletion of useful information. Large knowledge bases can cost a certain number of tokens. And in business, a manager must periodically validate what Dreaming Mode has modified, especially on critical subjects such as security or compliance.




