My AI dreams on Sundays
Dreaming is how an AI tidies its own memory. Once a week, ours looks back over what happened and fixes its notes, because cutting what an AI reads isn’t enough if what it reads is wrong.
In my last article, Claude and I cut what every session in our project reads by almost half. It ended on an awkward discovery. On a Monday we cut the index of the project’s shared memory from 12.5 KB to 3.2 KB. By Sunday it was back at 8.9 KB.
Nobody had been careless. Good work leaves notes behind: a decision, a trap to avoid, a job still in flight. The trouble is that notes don’t only pile up. They also go out of date, and a session that reads them has no way to tell which ones.
Memory is a prediction
That same week I came across Anthropic’s new article The components of agent memory. It opens with Kierkegaard: “life can only be understood backward, but it must be lived forward.” An AI has to decide what to write down before it knows what will matter. The article describes the fix as reflecting on logs to fix mistakes or produce new notes, a process “often called dreaming”.
Two stories in it, both from Claude playing Pokémon Red, changed how I thought about our setup.
In the first, an older model saved everything: “Sonnet 3.7 wrote 413 memory files across 225 folders and earned one badge.” A newer model wrote nine files in two folders, plus one summary file, and earned four. It stored only what the screen couldn’t already show it.
In the second, Claude wrote down the wrong side of the mountain for a landmark, announced “Mt Moon is behind me” and marked it done, then kept dropping back onto the route it had come from. A dreaming pass checked the note against what had actually happened and fixed it. That run went back into the cave and reached the next city. The run that kept the wrong note never did.
One line stayed with me: “Memory is, occasionally, a prediction.” Every note bets that a future session will need it, and will trust it without checking. A stale note isn’t just clutter. It’s a confident wrong answer waiting for the right question.
The article had a second lesson that matched how I like to work with Claude: “it helps to tell Claude what memory is for, but not how to use it.” A fixed rule such as “record only failures” took away much of what memory gave the stronger models.
I realised our weekly clean-up job was already a kind of dreaming. But it measured success in kilobytes, and it couldn’t see the project’s memory at all. So I shared the article with Claude and asked: “Perhaps with tips from this article, we can dream better by not just optimizing token count, but organizing data/memory so that these are more useful and relevant for our future work?”
Our own Mt. Moon
Before changing anything, Claude did a dry run over our memory, checking each note against the code, the Linear issues and the history. It found our own Mt. Moon:
One note still described the web server’s software and settings as they were before an upgrade three weeks earlier.
Two notes told future sessions that I paste routine instructions by hand, which had stopped the day before.
Two items on the “open” list had been finished for days.
Each of those would have sent a future session down the wrong path, confidently.
We also found our own 413 files. Many notes were build diaries: which change shipped when, in what order. The code history and our Linear issues already record all of that. For us, “the screen” is the code, the tickets and the history, so a note now earns its place only if it holds what those don’t: my decisions and the reasons behind them, traps, how to check something, and where things live.
How we dream now
Our project has two layers of what Claude knows, and now both dream every Sunday.
The first is the handbook every session reads. Its weekly job used to trim it. Now it reads the week’s code history first, corrects what the handbook says about anything that changed, and adds the lasting facts that sessions forgot to write down. Then it tests itself: it answers five questions the next few weeks are likely to bring, starting where a new session would start, and fixes the map where it got lost. It proposes a change whenever it corrected something, even if nothing got smaller. Its own instructions grew from 6.1 KB to 8.6 KB, the one place we deliberately added to what Claude reads.
The second is the project’s memory, which only a thread inside the project can read. So a small thread wakes every Sunday after the handbook job and goes through every note. Our first plan was for the handbook job to wake it, until we learned that a scheduled job can’t wake a conversation. Now the thread sets its own alarm and reads the handbook job’s results itself.
What it may do alone
The memory thread backs up every note before it touches anything, and writes a log of each change with the reason. Facts about how the store works don’t stay in memory: they move into the handbook through a pull request that I review and merge, like any other change. Anything that needs a decision, such as an old backup table to drop or an offer I never answered, goes on a short “please check” list for me. It doesn’t decide for me.
Two Sundays in
On the first night, it backed up all 49 notes, corrected 9 stale ones (the out-of-date server note among them), took 6 finished items off the open list, moved 3 facts into the handbook, archived 6 build diaries, and rewrote every note’s description to say when to read it. The memory index went from 8.9 KB to 5.1 KB.
A week later, the index had crept back to 10.4 KB. A busy week leaves a lot behind: 18 items on the open list had been finished since. The second run took the index to 4.6 KB, merged 28 overlapping notes about our social media posting into 8, and moved my payment rules into the handbook, where every session that touches payments will see them. The project went from 60 notes to 40, each short enough to read in one go.
It also saved the week’s feedback from me. One piece came from writing my last article: date a source by when it was first published, not by when I happened to see it.
That creep is the lesson. Context comes back every week, because good work leaves notes behind. A one-off clean-up doesn’t hold. A habit does.
One thing to copy
Once a week, have your AI check its notes against what actually happened. Correct what’s wrong, delete what your files and tools already record, and keep what they don’t: your decisions and their reasons, traps, and how to check things. Then ask it a few questions you expect soon, and see whether its notes find the answers. Tell it what the notes are for, and leave the how to it.
This works in any tool that remembers: ChatGPT’s memory and project files, Claude Projects, Gemini’s saved info, or a notes file next to your code. Run the prompt below once a week, as a scheduled task if your tool has one, or paste it in by hand. A tool with chat history can look back on its own; otherwise paste in a short list of what happened that week. Claude Code, Codex and Cursor can read the week’s changes from the code history themselves. You get back a short list of changes to approve, and a test of how well the notes hold up.
It's time for our weekly review of your notes. Look back over [this week's conversations / the list of what happened below] and compare it with what your memory and notes say.
The notes are there so a future conversation starts with what it needs and can trust it.
1. Correct: notes that are now wrong or out of date, with what is true now and how you know.
2. Add: lasting facts from this week a future conversation would need, such as decisions and their reasons, traps, or how to check something. Skip anything my files or tools already record.
3. Remove: notes that are finished, repeated, or only a diary of what happened when.
4. Test: write five questions I'm likely to ask in the next few weeks, and answer each using only your notes. Say where they fell short.
One line per change, with the reason. Don't change anything until I approve each one. Leave out passwords, keys and personal details.Your AI will remember less, and what it remembers will be true.
Michael Kuan runs iStyles.com, which makes Skins for phones, laptops, consoles and drones in over a thousand designs.


Discussion about this post