In 1953, a surgeon removed much of the hippocampus from both sides of Henry Molaison's brain to stop his seizures. The seizures eased. But from then on, he couldn't form new lasting memories. He could hold a conversation and lose it minutes later, while much of his older life stayed with him.
His case taught neuroscience that memory isn't one thing. Something has to capture today, and something else has to keep it.
Agents have the same problem. Anthropic just published how it gives Claude memory, and the design borrows from the brain, down to a step it calls dreaming. Here's how the brain does it, how agents copy it, and where I think it goes next.
Two learners, two speeds
The hippocampus learns fast. It records an experience in one go: where you parked, what someone just said.
The neocortex learns slowly. It holds what you know: language, faces, how the world usually works. It changes a little at a time.
Why have two? In 1995, James McClelland, Bruce McNaughton and Randall O'Reilly answered with a lesson from neural networks. A network that learns new things quickly tends to overwrite what it already knew. Researchers call this catastrophic forgetting.
The brain's fix, they argued, is to learn fast in one place and then teach the slow learner gradually. It mixes the new with the old, so nothing gets overwritten. That gradual transfer is called consolidation.
Language models ended up with the same split:
- The weights are the neocortex. They hold what the model knows, and they change only when a lab trains it again. Training shuffles huge amounts of data together, which is the mixing McClelland described.
- The context window is the hippocampus. It learns in one shot. Tell the model something once and it uses it right away. Then the conversation ends and it's gone.
- Catastrophic forgetting still applies. Train a model hard on one narrow new thing and it can lose skills it had. That's one reason agents don't learn by changing their weights between tasks. They keep notes instead.
So agent memory lives in a third place: files. Notes, logs, and folders the agent can read next time. That raises the brain's question. What goes into the notes, and who cleans them up?
The brain replays the day while it sleeps
In 1994, Matthew Wilson and Bruce McNaughton recorded neurons in rats as they ran a track, and again while they slept afterward. Cells that had fired together during the run fired together again in sleep. Later studies found the replay kept the order of the run and played it many times faster.
Much of this replay rides on short bursts called sharp-wave ripples, during deep sleep and quiet rest. When researchers cut the ripples short after training, rats remembered the task worse. The brain also chooses what to replay. Experiences marked as important, by reward or surprise, get replayed more.
AI has borrowed this trick before. DeepMind's 2015 Atari agent learned by replaying stored experiences, a method its authors described as biologically inspired.
Agents now dream
Anthropic's version is close to a copy. During a session, Claude writes quick notes to a memory folder, guessing what will matter later. Afterward, a separate pass called dreaming rereads the session transcripts and reorganizes the notes. It builds on sleep-time compute, an idea from Letta and UC Berkeley: use the idle time between tasks to think.
Dreaming does what replay does:
- It fixes mistakes. Playing Pokémon, Claude wrote down a landmark on the wrong side of a mountain and kept walking off a ledge. Dreaming checked the note against the transcript, caught the error, and rewrote it. With the fixed note, Claude got through. With the wrong one, it never did.
- It builds structure. Over 128 rounds of dreaming on 350,000 internal documents, Claude built a linked wiki. Answering from the wiki alone went from 13% to 48% as it grew.
- It promotes what matters. The most useful notes move to a small top layer that loads at the start of every session, like knowledge that has become second nature.
The brain also has a brake
Replay has a risk. Replay the same memories too often and they crowd out everything else.
In 2024, a team led by Azahara Oliva and Antonio Fernandez-Ruiz at Cornell found a brake. During sleep, cells in a small region of the hippocampus called CA2 set off bursts of firing the team named BARRs, for barrages. BARRs quiet the same neurons the ripples just replayed. When the team silenced the cells behind BARRs, replay grew too strong and too synchronized, and memory got worse.
Reactivation has to be balanced. Too little and nothing sticks. Too much and it all blurs together.
Agent memory needs the same brake, and Anthropic's examples show what happens without one:
- Saving everything. An older Claude model playing Pokémon wrote 413 memory files in 225 folders. It spent more time searching its memory than playing, and earned one badge. A newer model kept nine files plus one summary page and earned four.
- Copying instead of summarizing. One wiki grew larger than the documents it summarized. Like the map in Borges's story that was as large as the empire, it abstracted nothing.
- Repeating a mistake. A wrong note in the always-loaded layer gets carried into every session, like a false belief that was replayed until it stuck.
Anthropic's fix looks like the brain's. Keep the top layer small, push details down, and prune. Claude Code loads only the first 200 lines of its memory index into each session. Forgetting is part of the design.
Tell memory what it's for, not how
One result in Anthropic's post surprised me. The strongest models did best when told only that a memory folder existed. Adding a rule like "record only failures" cost them much of their gain. Detailed rules helped older models and got in the way of newer ones.
That's the argument from Every skill expires at the next model upgrade: the better the model, the less it needs a script. The brain works the same way. Nobody tells the hippocampus which memories to keep. Salience decides.
The path forward
Here's what I'd take from the brain for anyone building agents:
- Use two speeds on purpose. Let the agent jot quick notes while it works, and do the careful sorting offline. Don't make it stop mid-task to tidy its memory.
- Replay against the record. A note is only trustworthy if it can be checked. Keep the transcripts and check notes against them, the same way a test checks code.
- Build a brake. Cap what loads into every session and prune on a schedule. A memory that only grows becomes a hairball.
- Keep memory readable. Today, memory lives in files you can open, check, and delete. That's a feature. You can audit a note. You can't audit a weight.
The last step is the one the brain does best and models can't do yet. The brain moves what it learns into the slow learner itself, without overwriting what's already there. Catastrophic forgetting still stands in the way. When labs solve it, agents won't just take notes on your codebase. They'll know it, the way you know your way home.
Until then, let them sleep on it.