# Claude's agents dream to remember better

- URL: https://semanalia.com/posts/016-agent-memory-dreaming/
- Author: Semanalia
- Published: 2026-12-04
- Category: AI
- Reviewed: "The components of agent memory" by Anthropic (@AnthropicAI), Nov 6, 2026 · https://x.com/AnthropicAI/status/2118814753154064501
- Spanish original: https://semanalia.com/es/posts/016-memoria-de-agentes-dreaming/

> Anthropic explains how its agents "dream": they review what they learned between sessions to tidy their memory and fix mistakes. I read the whole article and checked it against other studies to separate what its numbers show from what they do not.

On November 6 Anthropic published a [post on X](https://x.com/AnthropicAI/status/2118814753154064501) that has about 2.2 million views: "Memory is what allows Claude to learn from experience." It linked to an article from its engineering team, ["The components of agent memory"](https://www.anthropic.com/research/components-of-agent-memory), written by Lance Martin, which explains how they make their agents **"dream"**: review what they learned between one session and the next so they can organize it, fix mistakes and find it faster next time. One line of disclosure: the models used to check this post are also Anthropic's, so open the sources and do not rely only on this summary.

To follow the article you need one picture. An AI agent is a program that works alone on a long task and starts every morning without remembering the day before, like an employee with amnesia who is left a folder of notes. That folder is what Anthropic calls memory: what Claude learns from experience and keeps between sessions as text it can read again. "Dreaming" is what happens while the agent is not working: **another model rereads the record of what happened and the notes, and cleans them up**, the way you might go over your notebook at night with the day's recording beside you. The idea did not start at Anthropic. The article credits researchers at Letta and the University of California, Berkeley, who published "sleep-time compute" in 2025, and compares it with what the brain is thought to do during sleep. In that paper, thinking ahead cut the computation needed at answer time by about 5 times, but on reasoning tasks, not memory tasks.

The first surprise is that saving less worked better. In a long Pokémon run, Anthropic compared the folders of two models after about 10,000 steps. Sonnet 3.7 had written 413 files (977,930 characters) and earned 1 badge. Fable 5 kept 10 files (43,406 characters) and earned 4. The first logged every battle and every item. The second ignored what the screen already shows, such as money or position, and kept plans and tested rules, for example what to do when several attempts in a row fail. **A useful memory holds what had to be worked out.** Two caveats: it is one run per model, and the models differ, so the gap is not only about memory style.

Another test used CL-Bench, a benchmark from UC Berkeley and Snorkel AI that measures whether an agent improves with experience. It had 30 questions about a database, each in a fresh session with the notes folder as the only bridge. With memory the newer models reach about 0.83 out of 1, and the gain is smaller for them because they started higher: Opus 5.5 goes from 0.655 to 0.838 and Opus 4.7 from 0.383 to 0.700 (Fig. 2). They hardly needed instructions, since telling them the folder existed was enough. **When the team imposed the rule "record only failures," Opus 5 lost 0.234 of the 0.264 points that memory gave it.** Older models went the other way: Sonnet 4.6 rose from 0.364 to 0.641 when told to read its notes before answering and to test its hypotheses.

The most striking part is the correction. In another run, Claude wrote down the wrong side of a mountain for a building, believed it had left the mountain behind, fell off a ledge onto the route it came from and repeated the mistake three times until it gave up. Anthropic then ran a "dream" on that folder: the model compared the note with the transcript of the run, spotted the error and rewrote it. With the corrected note, Claude went back into the cave and reached the next city at action 1,935; the run with the bad note never got past the mountain. **The transcript acts as proof**, and that matters, since a model that corrects itself with nothing external to compare against does not reliably improve (Huang et al., 2023). The risk being fixed is real: a 2025 study on memory management found that stored errors spread and degrade later tasks. This is one case with one run per arm, and the article does not say how many wrong notes dreaming fixes or how many new ones it introduces.

The largest test was a wiki. Anthropic used about 350,000 files from Stainless, the developer-tools company it bought in May (roughly 420 million tokens), and had Opus 5 agents write linked pages over 128 "dreaming" sessions, merge duplicates and check claims against the sources. On 25 questions, the wiki alone went from meeting 13% of the criteria to 48% (Fig. 3). **But searching the files directly scored 53%, above the wiki alone.** Together they reached 61%, with about 20,000 fewer tokens per question. On another set, 24 questions about a company merger, the wiki scored 87% against 73% for search on the questions that required combining several documents. On another task it added nothing, and one wiki ended up 1.77 times larger than the documents it summarized, a map as detailed as the empire, as in the Borges story the article itself cites.

There is one more practical lesson, about exact data. When several agents wrote at the same time to one shared table of contract terms, 41 of the 57 graded facts survived (72%), because some agents overwrote the work of others. After a loop in which Claude reflected on its failures and rewrote the instructions, each contract got its own page, written by a single agent with the terms copied word for word, and all 57 survived.

It helps to separate what is known from what is not. Anthropic designed and ran the tests, several comparisons are a single run, and the wiki was measured on 25 questions about one set of documents. There is no independent replication of these results, and other work calls for caution. In the Mem0 study, a memory system reached 66.88% on a long-conversation test, while leaving the whole conversation in context scored close to 73%, with about 12 times the latency (my calculation from its tables). CL-Bench itself concludes that, in its tests, plain in-context learning beat systems built to manage memory. And Letta, which competes in this space, published that an agent with files and search tools scored 74.0% against Mem0's 68.5%, a figure of its own that nobody has replicated. The cost is also unknown: the article admits dreaming takes compute, and the documentation for the feature, which is still a research preview with access by request, only says it is billed at normal token rates and takes minutes to hours.

What the article does not cover is how to bring this into daily use with a coding agent or an assistant that has a notes folder. Four ideas come out of its own data. Keep the index short: Claude Code loads only the first 200 lines or 25 KB of its MEMORY.md file at the start, so that file works better as a list of links than as a drawer of details. Each note should say **how it is known**, with the exact sentence from the conversation it came from and the date someone last checked it, since a note without that is a rumor the next session cannot weigh. Dreaming does not have to be a product either: once a month you can ask a model to read your notes with the transcripts beside it, write the result to a new folder and let you review it before it replaces the old one. If you do not keep transcripts there is nothing to correct against, and all you can clean up is duplicates and size. And keep keys out of the notes: what comes from a web page or an email is information, not orders, because two papers, AgentPoison and MINJA, show how a poisoned memory can steer an agent. This post's skill, semlethe, automates that review with scripts that run on your machine and two subagents, one that prepares the dream and one that reviews it.

Behind the headline that "Claude dreams" sits an idea anyone can use without buying anything: **a memory needs someone to review it with evidence in hand**, and that someone can be a model, a person or both. What Anthropic adds is a way to measure it, with its limits in plain view.

## Claims checked

1. "Dreaming helps Claude organize what it has learned." **Checks out.** The wiki went from 13% to 48% over 128 sessions, but on one task it added nothing and one grew 1.77 times larger than its sources. No outside replication.
2. "Dreaming corrects its mistakes." **Unverified.** One well-documented case, with one run per arm. They do not publish how many wrong notes it fixes or how many it introduces.
3. "It helps find what it needs more easily." **Checks out.** With search, 61% against 53% and about 20,000 fewer tokens per question. If one document is enough, the wiki does not improve things.
4. "Saving less can work better than saving everything." **Unverified.** A model with 413 files earned 1 badge and another with 10 earned 4. Different models, one run each: not enough to conclude.
5. "Strong models should be left to decide what matters." **Checks out.** Opus 5 needed only to know the folder existed. Imposing "record only failures" cost it 0.234 of 0.264 points of gain.

## Questions this post answers

- **What is dreaming in Claude's agents?** A review between sessions: a model rereads an agent's logs and notes to fix mistakes, write new notes, build maps such as a wiki and decide what gets loaded at the start of the next session.
- **Does a wiki work better than searching the documents?** Not on its own. In Anthropic's test the wiki alone met 48% of the criteria and search alone 53%; together they reached 61%. On questions that one document can answer, the wiki added nothing.
- **Do you need many rules about what the agent should save?** With strong models, no. Imposing "record only failures" took 0.234 of the 0.264 points that memory gave Opus 5. Older models did improve with instructions.
- **Can you trust these numbers?** With caution. Anthropic designed and ran the tests, several are a single run, and the wiki was measured on 25 questions about one set of documents. Other studies show memory systems do not always beat simpler setups.

## Sources

1. Lance Martin (Anthropic), "The components of agent memory", Nov 6, 2026 (https://www.anthropic.com/research/components-of-agent-memory).
2. Anthropic (@AnthropicAI), post on X, Nov 6, 2026 (https://x.com/AnthropicAI/status/2118814753154064501).
3. Anthropic, "Dreams" documentation for Claude Managed Agents, read on Dec 4, 2026 (https://platform.claude.com/docs/en/managed-agents/dreams).
4. Anthropic, Claude Code memory documentation, read on Dec 4, 2026 (https://code.claude.com/docs/en/memory).
5. Anthropic, "Anthropic acquires Stainless", May 18, 2026 (https://www.anthropic.com/news/anthropic-acquires-stainless).
6. Lin, Snell, Wang, Packer, Wooders and Stoica, "Sleep-time Compute: Beyond Inference Scaling at Test-time", arXiv, 2025 (https://arxiv.org/abs/2504.13171).
7. Asawa et al., "Continual Learning Bench: Evaluating Frontier AI Systems in Real-World Stateful Environments", arXiv, June 2026 (https://arxiv.org/abs/2606.05661).
8. Huang et al., "Large Language Models Cannot Self-Correct Reasoning Yet", arXiv, 2023 (https://arxiv.org/abs/2310.01798).
9. "How Memory Management Impacts LLM Agents: An Empirical Study of Experience-Following Behavior", arXiv, 2025 (https://arxiv.org/abs/2505.16067).
10. "Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory", arXiv, 2025 (https://arxiv.org/abs/2504.19413).
11. Letta, "Benchmarking AI Agent Memory: Is a Filesystem All You Need?", Aug 12, 2025 (https://www.letta.com/blog/benchmarking-ai-agent-memory/).
12. "AgentPoison" (https://arxiv.org/abs/2407.12784) and "Memory Injection Attacks on LLM Agents via Query-Only Interaction" (https://arxiv.org/abs/2503.03704), arXiv, 2024 and 2025.

## Figures on the web page

- Fig. 1, The article in four numbers: Anthropic, “The components of agent memory”, Nov 6, 2026. These are figures from the company's own tests.
- Fig. 2, How much each model gains with memory: Mean score with memory on CL-Bench's database task; the detail is the score without memory. Gain = with memory minus without: Opus 5.5, 0.838 − 0.655 = 0.183; Opus 4.7, 0.700 − 0.383 = 0.317. Anthropic's figures.
- Fig. 3, Wiki, search, or both: Share of criteria met on 25 questions about roughly 350,000 files. Difference: 61 − 53 = 8 points for wiki plus search over search alone. Anthropic's figures, a single series of tests.
- Fig. 4, Five claims, one by one: Checks out: what has been published supports it. Contradicted: the data says the opposite. Unverified: it can't be checked.

_Charts and the full layout are on the web page._