How Claude Actually Remembers Things: Anthropic's Four-Layer Memory Design
📖 Glossary
AI Box (also known as Agent Computer / Agent PC), is a dedicated local hardware device that runs AI Agents. Pre-installed with an AI agent management system, plug-and-play, running 24/7. Users can remotely command AI to work via Discord, Slack, Telegram, WhatsApp, and more.
Anthropic published the complete design of Claude's agent memory on November 6. The most interesting part isn't the architecture diagram — it's a comparison that inverts what most people assume about AI memory.
One model, given the same game, accumulated 413 memory files and 970,000+ characters. It earned one badge.
Another model used 10 files and 43,000 characters. It earned four.
The model that remembered more scored worse.
The four layers
The core of the write-up is a bottom-up hierarchy:
- Transcripts — a searchable event log of what happened
- Memory notes — notes Claude writes itself, keeping the rules, facts, and failures worth retaining
- Memory representations (such as a wiki) — notes organized into a linked knowledge network
- Injected context — the top layer, preloaded into every new session
The top layer has a hard constraint: Claude Code loads only the first 200 lines, or 25 KB, of MEMORY.md. The reasoning is stated plainly — injected memory eats token budget, and a single wrong note gets carried into every session, so the top layer has to stay thin.
Dreaming: the model reviews its own work

The organizing work happens through a mechanism called dreaming. Claude uses the idle time between interactions to reread its own logs and notes, correct errors, create new notes, build or repair the wiki, and promote important memories upward.
The idea comes from sleep-time compute — during sleep the hippocampus replays the day's experiences, and a good deal of memory consolidation happens then. Anthropic borrowed the same approach for agents.
One detail makes the design concrete. On the second dreaming pass, Claude found 9 links in the wiki pointing at pages that didn't exist, repointed them at the correct pages, and added 3 new pages. How did it know they were wrong? It went back to the original transcripts — the ground truth it could check against.
What it does on real data
The pipeline was run over roughly 350,000 files and 420 million tokens, sourced from Stainless, the company Anthropic acquired in May.
After dreaming across 128 sessions, the wiki grew from 103 pages to 222, and links from 766 to 12,893. On accuracy, wiki alone went from 13% to 48%; wiki plus search reached 61%.
The limitations they don't hide
The wiki can grow larger than the material it came from. In one task the source was 10 documents totaling 115 KB; the wiki came to 68 pages and 203 KB. The author borrows a Borges line: Claude made an extremely detailed map while abstracting nothing away.
Dreaming costs extra compute. And multiple agents sharing one wiki overwrite each other — in a contract task where several agents wrote into a shared clause table simultaneously, 57 facts survived and only 41 made it through.
What this implies for running memory locally

Memory needs three things to work: somewhere to store it, idle time to consolidate it, and something that stays on. Claude puts all three in the cloud — logs at Anthropic, dreaming on their compute between interactions, consolidated notes preloaded back into the next session.
The KAIHE AIBOX takes the other path. It's a dedicated agent computer with the agent stack preinstalled — OpenClaw and Hermes both run on it — and it stays powered on around the clock. Memory notes are local files, and the idle time dreaming needs is simply there. On this particular problem, 24/7 isn't a convenience feature; consolidation doesn't happen if the machine isn't running.
The line worth keeping from the original: tell Claude what the memory is for, but don't prescribe how it should use it. In practice that means you state clearly which things should be remembered, and let it decide what to keep and how to organize it.
Source: Anthropic engineering blog on effective context engineering for AI agents, and the CL-Bench evaluation it cites.
For more information, search [KAIHE AIBOX].