Smells from the Monastery of Panfi
QbitAI is public.
The mechanism behind Claude's monotonous memory is completely revealed, and the core of it is yoga.
Dreaming about it。
Let the model be used in the intervals of sessionsCalculating powerSleeping in a dream, re-examining past experiences, correcting mistaken memories, and organizing scattered information into knowledge that can be repeated across sessions.

An old version of Claude, who hadn't learned to dream, played the game of a boy who could dream of breaking his own wall three times in a row after falling from a cliff to the old road, and it was right in the middle of the execution record:
I still have to stop and keep turning around.

After learning to dream, not only is it easy to filter out inefficient interference; after filtering 350,000 complex corporate documents, the accuracy rate can directly jump to nearly 50 percent.
It's a game where you have to think, and now you have to sleep before you play games.
How to calculate long-term knowledge offline
The idea that Claude dreamed actually drew on the human memory mechanism.
Why do people dream while they sleep?
Neuroscience studies have shown that the hippocampus receives high-density short-term memory fragments during the day;
In the resting phase, the brain reverses the day's experience, filtering, absorbing and structuring fragmented facts, gradually integrating them into the cerebral cortex and transforming them into long-term knowledge.
Anthropic combines this idea of instantaneous recording and offline compilation with the idea of using Agent memory systems.
In the existing Agent architecture, the system often faces two challenges:
- The above context window expands as the number of rounds of tasks increases, resulting in reasoning delays and a surge in call costs;
- Rather than relying on raw text abstract or vector retrieval (RAG), critical technical details can be easily missed and logical chains can be broken.
Anthropic's solution is to introduceThis is the first time I've ever done sleep-time computing.When the user is offline or interaction is suspended, start the Dreaming process.

The architecture divides Agent memory into four levels:
- Original session logs: an underlying real log containing interactive input, model output, tool calling parameters and feedback execution;
- Memory notes: Points of local experience recorded by an agent when performing a task;
- Layered memory: maintaining, structuring, and containing hyperlinked networked databases across sessions;
- Enter the following: High-priority index information pre-loaded at the start of a new session.
When the interaction is suspended, the model starts the Dreaming process in the background, synchronizes the original session record, cross-checks the contents of the notes, corrects logical contradictions, and thus updates the overall memory representation.
And the reason why offline memories need to be sorted is becauseThe core goal of recording memories is to provide a valid precedent for subsequent tasks。
The method of recording the base tends to preserve detailed operational flows;
In Anthroic's view, a more effective memory mechanism is to refine common operating rules, erroneous records, and decision-making links with replicable value, so that they can be directly invoked in subsequent sessions.
413 notes less than 10 core rules
This system is not good enough, and you can dream of becoming a master examiner.
Early versions of Claude (such as Sonnet 3.7) recorded information in no small detail, playing a monster, storing a file; reaching for an elf ball, storing a file; along the way the NPC said nonsense, also storing a file separately.
Unknowingly, it created 413 memory files, which were filled with 225 folders, with a text volume of almost 980,000 characters.
This method of recording has led to a heavy maintenance burden.
In the next 17 steps, the model rebuilds 6 files, deletes 9 files...
However, most of the computing resources are used to compile notes, and the game's characters do not move.
At the end of the game, only one doubles medal was awarded.
While more advanced models (such as Claude Fable 5 and the Opus series that followed), the first thing to learn is to separate.
The number of gold coins, the current coordinates, the real-time numerical values of the bloodlines? These are obvious information that can be seen at a glance on the game interface, completely unremembered!
The entire system consists of only 10 core files (including 9 classification modules and one top layer global.md) with a total of 430,000 characters.

It's like this.Take it easy.The tactics resulted in greater thrust efficiency, and Claude's operative character went straight into the hall, even taking four medals.
What about the new version?
The game's interface does not directly tell the game's tactical knowledge. For example, with seven consecutive elven balls without catching the Shark King, it refines the rule: the Shark failed to catch three consecutive times, and should adjust the wait key interval.
In the CL-Bench 1.0 database benchmark test, this integration of error sampling, attribution analysis, and verification results with the final rule matched the mechanism that raised the average score of Opus 5.5 from 0.655 in non-long-term memory to 0.838.

The above-mentioned moon-view cliff-death cycle confirms the ability of dreams to correct mistakes.
Without the dreaming mechanism, Claude took the death note that wrote "Mt Moon DONE" but in the opposite direction, only reinforcing his own misconception, even adding to the brain that I was just walking westward with the excuse of a crazy, ultimately mental explosion strike.
After the introduction of Dreaming, offline computing intervened.
The model re-examined the original bottom log with its eyes examined, contrasts with the actual coordinate feedback, and corrects the error on the spot: oh no, my note direction is reflected!

So it re-writes the toxic route note directly in the background.
The next day, he woke up again, headed through the cave, overturned the cliff and headed straight for the city of Huachuca.

Structured knowledge networks
In addition to single-player games, offline dream machines also show structured advantages when dealing with large-scale enterprise data.

Anthropic pulled out the internal database of its acquired software company, Stainless.
There are about 350,000 documents, totaling 420 million tokens.
Claude Opus 5 was then sent to build an enterprise knowledge base and set up a comprehensive review of 25 high-difficulty cross-documentary complex problems.
The model is constantly dreaming at the intervals of the sessions, weaving the scattered content into enterprise wikis with hyperlinked networks:
- End of the second round: generate 103 pages, 766 associated links;
- Round 128 ends: expanded to 222 high-cluster pages, 12,893 links.

Test data shows that only the knowledge network responds, with test scores rising from an initial 13% to 48%;
Knowledge Networks combined with original document retrieval, increasing the overall score from 53% to 61% of pure retrievals;
In terms of resource consumption, the combined scheme reduces the average single-use consumption of around 20,000 tokens.
Wiki's advantages are more pronounced in the task of integrating information across documents.
In cross-document multiple-jumping reasoning tasks such as merger and material analysis, the response accuracy rate for structured knowledge networks is 87%, higher than 73% for those that rely on document retrieval alone.
However, the research team also pointed to the problems of redundancy and information loss that knowledge abstraction can cause.
In a test with only 115 KB of raw input, Claude's knowledge file volume reached 203 KB, equivalent to 1.77 times that of the original document, and the abstract lost its compression meaning.
In addition, when multi-Agent collaboration edits shared contract forms, 16 of the original 57 key facts were lost due to the lack of concurrent controls.
The researchers then asked Claude to analyze the causes of the failure and adjust the knowledge base to build instructions.
Each contract is organized by an independent agent, and the terms of the contract are kept as original as possible, no longer allowing multiple agents to modify the same summary table together.
After rebuilding the Wiki, the legal briefing generated meets all 57 rating criteria.
In addition, Dreaming can also fix broken links in knowledge libraries.
Once, Claude discovered nine links to a Wiki page that did not exist.
After re-checking, it changed these links to the correct pages that already existed, while adding three new pages, including indexing and explanatory documentation.
From adding knowledge, correcting errors, to maintaining relationships between pages, Dreaming can be involved in processing.
However, these operations also consume computational resources, and the more complex a Wiki is, the greater the amount of work it takes to maintain it.
Memory also controls volume.
The knowledge base can be expanded, but the information that actually enters Claude's context cannot be increased indefinitely.
Anthropic specifically mentions Claude Code's automatic memory design in the article.
Each time a new session is started, the system does not load the entire automatic memory directory.
It only loads 200 lines or up to 25 KB of content at the beginning of the MEMORY.md file.
This section mainly acts as an index.
Claude can first find out what information he keeps and where the corresponding files are.
Read or retrieve the lower memory when you really need details.
High frequency content, often required for follow-up tasks, can be upgraded to a more accessible position.
Details do not need to be uploaded directly each time, but can be left in the bottom layer with only the relevant index.
Moreover, the cost of dreaming itself is also calculated.
When the front desk executes a task, recording too much content will affect the task's progress; all of it is handed over to the back desk to be sorted, and some important information may not be available in time for the next operation.
Historical records will also become obsolete as the environment changes. For example, the code library has been reconstructed and the old operating rules may no longer apply.
Therefore, when memory is created, how long is checked, and what content is worth preserving for the long term still needs to be adjusted according to the task scenario.
Anthropic has not yet given a standardized dream rhythm for all missions.
The link is as follows:
[1]
[2]