Andrej Karpathy Predicted AI Agents Need to "Dream" — Anthropic Just Shipped It
A nine-month-old Karpathy prediction about AI memory becomes Anthropic's new overnight consolidation feature — plus a free routine that replicates it for anyone not on an enterprise plan.
Posted
3 days ago
Duration
Format
Tutorial
educational
Views
57.5K
1.2K likes
57 · 43
Big Idea
The argument in one line.
Anthropic's new enterprise-only "dreaming" feature, which reconciles an AI coding agent's memory across sessions overnight, validates Andrej Karpathy's prediction that agents need sleep-like consolidation — and the same core mechanic can be replicated for free with a nightly Claude Code routine that diffs session transcripts against memory and proposes corrections.
Who This Is For
Read if. Skip if.
READ IF YOU ARE…
You run Claude Code or a similar coding agent daily and already maintain a memory or CLAUDE.md file that has drifted stale or accumulated duplicates.
You run multiple agent sessions or subagents and want patterns from past sessions to inform future ones automatically.
You want the benefit of Anthropic's "dreaming" concept without an enterprise plan or extra per-run API billing.
SKIP IF…
You don't use an AI coding agent with any persistent memory file — there is nothing here to consolidate.
You're specifically after Anthropic's actual enterprise dreaming feature rather than a DIY workaround.
TL;DR
The full version, fast.
Nine months before Anthropic released it, Andrej Karpathy told Dwarkesh Patel that AI agents were missing a sleep-like process to consolidate memory between sessions. Anthropic's new "dreaming" feature does exactly that: it scans recent agent sessions, finds corrections and stale notes, and rewrites memory automatically — but it's enterprise-only and metered on API credits. The workaround is a nightly Claude Code routine: read the last 24 hours of session transcripts, diff them against the current memory file, and output a numbered list of proposed corrections with quoted evidence, auto-applying only trivial fixes and holding everything else for human approval in a review report.
Free for members
Chat with this breakdown — free.
Sign in and you get 23 free chat messages on us — ask for the hook, quote a framework, find the exact transcript moment, generate a markdown action plan. Bring your own key when you want unlimited.
Cold open framing Karpathy as one of AI's sharpest minds, teeing up his year-old Dwarkesh interview clip.
00:35 – 01:25
02 · What Karpathy means by dreaming
Plays Karpathy's own words: models restart from zero tokens every session, unlike human sleep which distills the day into weights.
01:25 – 01:56
03 · Problem 1: split focus
An agent updating its own memory mid-task divides attention between finishing the job and maintaining notes, illustrated with a chef writing a recipe book mid-service.
01:56 – 02:27
04 · Problem 2: patterns obscured
In-band memory writes only see one session at a time, so cross-session patterns never surface — compared to an NBA coach judging a roster off one game out of 84.
02:27 – 03:05
05 · Problem 3: memories go stale
Unreviewed memory files accumulate disagreeing duplicates and outdated notes, compared to Google Maps directions based on decade-old roads.
03:05 – 03:56
06 · Anthropic's official dreaming feature
Anthropic's own clip describing the dreaming process, plus the reported ~6x task-completion gain at early access customers Harvey and Rakuten.
03:56 – 05:54
07 · The free dreaming prompt setup
Walks through the actual prompt text: set up a memory system, then create a /dream skill that reads the last 24 hours of session transcripts and proposes numbered corrections.
05:54 – 06:41
08 · Running dreaming as a test
Shows the routine registered in Claude Code's Routines panel ('Nightly Dream') and a live run reconciling memory against recent sessions.
06:41 – 08:00
09 · The dream report in action
Reviews real proposed changes in the dream report: a new fact about a video editor, and a CLAUDE.md file identified as 105 days stale.
08:00 – 09:00
10 · Cofounder feeling + community pitch
Closes on the routine feeling like a cofounder reviewing every session, then pitches the creator's paid AI community.
Atomic Insights
Lines worth screenshotting.
Andrej Karpathy predicted nine months before Anthropic shipped it that AI coding agents needed a sleep-like 'dreaming' process to consolidate memory across sessions.
In-band memory systems force an agent to split attention every session between finishing your task and updating its own memory file.
A memory file written turn-by-turn by whichever agent session happens to be running never sees the wider pattern across all your sessions — it only ever sees one session at a time.
Memory files degrade the same way any unmaintained record does: duplicates that disagree, notes that go stale, and confidently wrong guidance nobody flagged.
Anthropic's official 'dreaming' feature scans recent agent sessions and transcripts, then automatically rewrites memory content to reflect current patterns and corrections.
Early enterprise users Harvey and Rakuten reportedly saw roughly a 6x jump in task-completion rate after enabling dreaming.
Anthropic's dreaming feature is enterprise-only and billed on API credits every time it runs, which rules it out for most individual Claude Code users.
A nightly Claude Code routine can replicate the core mechanic for free: read the last 24 hours of session transcripts, diff them against the memory file, and propose numbered corrections.
The safer default only auto-applies trivial fixes like typos and index repairs — everything else waits for human approval in a 'dream report.'
A working review pass catches concrete things a human would otherwise miss over time, like a memory file gone stale for 105 days or a wrong detail about a collaborator.
Takeaway
Memory that reviews itself beats memory an agent edits mid-task.
AGENT MEMORY
A free nightly routine that diffs your agent's session transcripts against its memory file — proposing corrections instead of applying them silently — gets you most of what Anthropic's enterprise-only 'dreaming' feature promises, without the API bill.
02What Karpathy means by dreaming
An AI agent's context window is really just short-term memory — it has no equivalent of the offline consolidation process human sleep provides.
The core failure mode a consolidation process fixes: agents restart from zero context every session and never carry forward what they learned.
03Problem 1: split focus
Asking an agent to finish your task and simultaneously maintain its own memory file forces it to divide attention between the two, degrading both.
04Problem 2: patterns obscured
A memory file updated in-band by whichever agent happens to be running only ever sees one session's worth of context, so cross-session patterns never surface.
05Problem 3: memories go stale
Without a review pass, a memory file accumulates contradicting duplicates and outdated notes that quietly steer future sessions in the wrong direction.
06Anthropic's official dreaming feature
A dedicated consolidation process that scans recent transcripts across sessions and rewrites memory automatically can produce large task-completion gains — early adopters reported roughly 6x.
The catch with an official enterprise version: it's metered on API credits per run, so it isn't yet practical for individual users to run constantly.
07The free dreaming prompt setup
The DIY version is a written routine: read the last 24 hours of session transcripts, diff them against current memory, and output a numbered list of proposed corrections with quoted evidence.
Auto-approve only reversible, low-risk fixes like typos and index repairs; require human sign-off on anything that changes actual facts or preferences.
08Running dreaming as a test
Before scheduling anything automatic, run the consolidation pass once manually and review exactly what it proposes changing.
09The dream report in action
A working review pass catches concrete things a human would miss over time — a stale file untouched for 105 days, or a wrong detail about a collaborator that sat uncorrected.
Glossary
Terms worth knowing.
Dreaming (Claude Code)
An overnight process, first shipped by Anthropic for enterprise customers, that scans an agent's recent session transcripts and rewrites its memory file to reflect current patterns and correct mistakes.
In-band memory
A memory file that agents read and write to during the same session they're completing a task in, as opposed to updating it in a separate, dedicated pass.
Memory file / CLAUDE.md
A persistent markdown file an AI coding agent reads at the start of every session to recall facts, preferences, and prior decisions.
Session transcript
The saved log of everything said and done in one agent session, used as the raw evidence a consolidation process reviews.
Routine (Claude Code)
A scheduled, recurring automated task a Claude Code user can configure to run without manual triggering, such as nightly at a fixed time.
Dream report
A generated summary of proposed memory corrections, presented for human approval rather than applied automatically.
Resources
Things they pointed at.
00:15channelAndrej Karpathy interview with Dwarkesh Patel
“These models, when you boot them up, they have zero tokens in the window. They're always like restarting from scratch.”
the exact line the whole video is built on→ TikTok hook↗ Tweet quote
01:44
“It's sort of like a chef with a dinner service who's trying to get everyone their chickens, but at the same time, he has to write his chicken recipe book.”
“Kinda like an NBA coach out there looking at one game out of the season of 84 games and trying to rearrange rosters.”
sports analogy that lands the pattern-blindness problem→ newsletter pull-quote↗ Tweet quote
02:35
“This one's like Google Maps giving you directions based on the roads ten years ago.”
tight, punchy analogy for stale memory→ TikTok hook↗ Tweet quote
03:25
“The businesses, Harvey and Rakuten, who actually got first access to this dreaming feature, saw massive upside, something like a six x times task completion rate.”
hard number for a case-study clip→ newsletter pull-quote↗ Tweet quote
07:53
“And now it feels like I really do have a cofounder working beside me scanning all of my conversations with it for these minute details.”
emotional payoff line closing the demo→ IG reel cold open↗ Tweet quote
The Script
Word for word.
Read-along
Don't just watch it. Burn it in.
See every word as it's spoken — crank it to 2× and still catch all of it. The same dual-channel trick behind Amazon's Kindle + Audible.
17px
metaphoranalogy
Andre Kapathi might be the brightest mind in AI. And nine months ago, in this interview with Dwarkesh, he revealed what he thought was the biggest current flaw with AI and Claude setups. Roll the clip.
I feel like when I'm awake, I'm building up the context window of stuff that's happening during the day. But I feel like when I go to sleep, something magical happens where there's some process of distillation into weights of my brain, and this happens during sleep. We don't have an equivalent of that in large language models.
These models, when you boot them up, they have zero tokens in the window. They're always like restarting from scratch. I almost feel like we are redoing a lot of the cognitive tricks that evolution came up with through a very different process, but we're gonna converge on a similar architecture cognitively.
See, Kapathi says the problem with your Claude code setup is it can only learn while you're actively prompting it. But if there was some form of magical dream like state that it could enter where it could distill and reconcile all your sessions, see the patterns between them, and update and improve himself based on your goals even when you're not actively prompting it, he calls this dreaming your Claude code could become 10, a 100 times more powerful.
Well, fun fact for all of us. Since Kapathi's interview with Dwarkesh, Anthropic, which Kapathi now works at, has actually dropped this exact feature, which now allows your Claude code to dream.
And according to Kapathi, this is so powerful because it fixes the three biggest problems that you currently have with your Claude memory even if you're using Boris' cutting edge self learning MD file. And so Anthropic say, if you're not currently using dreaming, you have three big problems with your in band memory.
Firstly, you have a split focus. So your agent, while you're prompting it, is trying to split its attention between finishing the task you're giving it and maintaining and updating your memory file.
It's sort of like a chef with a dinner service who's trying to get everyone their chickens, but at the same time, he has to write his chicken recipe book. He's just dividing his energy and dividing his focus.
Anthropics say the second biggest problem is something called patterns obfuscated. So it's agents writing to your memory file in band miss patterns from across the sessions and across different agents.
So if you have every single agent you're asking to do a task writing to that memory file, it does not have a wider context window about the patterns through all of your sessions. Kinda like an NBA coach out there looking at one game out of the season of 84 games and trying to rearrange rosters and orders and who's shooting what shot based on just that one performance.
And then thirdly, Anthropics say that memories go stale. So duplicates that disagree, notes gone stale, and your memory file being confidently wrong.
So this is basically your memory file is written by these individual agents who don't have this context. They could be adding duplicates that disagree with each other, or they could be stuff in your memory file that's from six months ago that is no longer true and therefore guiding your work in the wrong direction. This one's like Google Maps giving you directions based on the roads ten years ago.
And this is why Kapathi was harping on, we needed something like dreaming for our Claude code agents to actually reach their maximum power. And like I said, Anthropic have recently dropped this official dreaming feature. Let's hear it from them directly.
We've been experimenting with a couple of different types of processes,
and we landed on one. We call this process dreaming. Dreaming is a process that looks for patterns and mistakes across your recent agent sessions and their transcripts and automatically produces organized
and up to date memory content. The ultimate goal of dreaming is continuous self learning and self improvement, where the next day's agents automatically get better based on the learnings and the work of the previous days. And, apparently, the businesses, Harvey and Rakuten, who actually got first access to this dreaming feature, saw massive upside, something like a six x times task completion rate compared to before they let their agents dream.
And so I have good and bad news for you. Firstly, dreaming is here and it's really effective. However, it's currently only limited to enterprise customers, and it also uses API credits, which means you're paying every time your is dreaming, and we want it to dream often.
So we don't want that. Onto the good news. I have for you this prompt right here, which is in full Andre Kapathi alignment, a way to set up a routine for your Claude code to dream every night and reconcile all your sessions, see the overall patterns, remove duplicates, and make your Claude way more powerful.
So to set this up, copy the prompt, come into your Claude code, and simply just paste it in. So the prompt says that we're gonna set up a dreaming routine for your Claude code modeled on Anthropic's dreaming feature so that Claude code can learn from your sessions while you are snoozing. It's first gonna set up the memory.
If it already has a memory system, it's gonna work around that and then set up an alignment with how Kapathi wants an AI to dream. The second thing is it's gonna create a skill called forward slash dream. And this skill, what it does is it's gonna read your session transcripts transcripts from the last twenty four hours across different sessions.
This is the real breakthrough about it. Compare them against the memory file and what's currently stored and find corrections. I gave you preferences.
I repeated new facts worth keeping memories that are now stale or wrong and duplicates. Propose each change in a numbered list. You're gonna get a report in a numbered list with a short quote from the transcript as evidence.
Then auto apply only tiny safe fixes such as typos and index repairs. You don't to approve those. You can also set it so that you auto approve everything if you prefer to be a little more fast and loose.
But by default, we've set it at everything else will wait for you. You can do it inside the console here, or I've actually got a report in a HTML format where you can click approve. I'll show you that in just a second.
If you run overnight with nobody here, write the proposals to the Dream report so I can review them in the morning. The schedule, make Dream run at 3AM every night using whatever the computer supports, which at the moment we are using a routine. When you're done, run Dream once right now as a test and show me what it proposes.
Now if you are running this as a test, you are gonna need to have used Chord or Chord Code in the last twenty four hours for it to have new context to actually use to update your memory files. So you can see in my routines, I've actually been running this for a couple of weeks. We have the nightly dream feature right here.
Now you can see it started on July 19, July 20, July 21. I did actually went and had hair surgery if you can't tell. My hair is currently missing, uh, for nine days, so I didn't actually use cord code over those nine days, which means there was nothing to actually dream about.
But now since I'm back active, mine's working again, I can see it's been doing it over the last four days since. And you can see what happens. It says invoke the dream skill with no arguments.
Use the skill tool, the skill dream, which we just read through, and basically, this is the context that you need in order to actually do the dream. So it went and did that while I slept every night at 3AM when I used cold code the day before. And this is the report.
This is what I call dream gate, which it will constantly add to until I approve or don't approve. So you can see I can reject or approve the changes that the dream state has made. If I scroll down, you can see other things.
So this is an addition. This was an update. So the addition, Benjie isn't solely.
He has a dedicated video editor who is a she. This is true. Great she, by the way.
Thanks for cutting this. Who cuts the Dreamlabs videos from the b roll. Okay.
Great. So it's learning more about me. It's learning more about my business, my workflows, my setup, so I can approve that, and it's going to add it into my Claude memory files.
You can see this one right here. Claude code m d is now a hundred and five days stale, and its TBDs are already answered in memory. Okay.
So we can get rid of that, which has been a memory file that's been slowing down my Claude for a hundred and five days and not actually being used. You can see here it's identified where I saved my video and thumbnail sources and assets in an iCloud drive folder, which is fantastic because now I can get Claude to actually access that directly and help me with the saving and opening and changing of those files so I can approve something like that.
And now it feels like I really do have a cofounder working beside me scanning all of my conversations with it for these minute details.
And the biggest thing is what Dreaming really does is it opens up patterns between sessions to be recognized where if you're just using an agent to write to the MD file, you don't get that opportunity. And if you want to learn more tips from the greatest minds in AI, we have the world's best AI community, which we're just getting started.
We wanna grow this to be a massive place. Well, I personally will take 95% of the work out of your hands, break down the top people like Kapathi, like Boris Churney, literally the creator of Claude Code.
Even business minds like Alex Homozi to see what they're implementing in their businesses. Literally, you can't get more cutting edge than someone like Andre Kapathi and bring those strategies back for you to implement in your routines and your business. So if you'd like to be on the cutting edge, come and join us inside this community.
I'm personally in there as is our top AI researcher. And together, we can conquer this AI revolution using the best tools, playing with an unfair advantage in the business marketplace.
Looking forward to seeing you in there. Thanks so much. I'll see you in the next video.
The Hook
The bait, then the rug-pull.
Nine months before Anthropic shipped it, Andrej Karpathy told Dwarkesh Patel that AI agents were missing the one thing that makes human memory work: sleep. This breakdown checks that claim against what Anthropic actually released, then hands over the free routine that gets Claude Code most of the way there without an enterprise contract.
Frameworks
Named ideas worth stealing.
01:25list
The Three Problems With In-Band Memory
Split focus
Patterns obfuscated
Memories go stale
Anthropic's stated rationale for why memory files an agent updates mid-session, without a separate review pass, degrade over time.
Steal fordiagnosing why any agent's persistent memory/notes file has become unreliable
CTA Breakdown
How they asked for the click.
VERBAL ASK
08:25product
“come and join us inside this community... I'm personally in there as is our top AI researcher”
soft pitch at the video's close for the creator's paid AI community, positioned as pre-digested breakdowns of Karpathy, Boris Cherny, and Alex Hormozi's strategies; link is in the description, not spoken.
A tweet-reaction breakdown of Anthropic's viral five-archetype framework — and the Slack-embedded Claude agent quietly filling the sixth role nobody named yet.
A breakdown of Claude Code's native /loop and /goal commands, shown live on a race-simulator agent and a newsletter-writing agent that grades its own drafts until they pass.
A creator runs the same workout-app build through Opus 4.8, Fable 5, and three advisor-mode hybrids to find the cheapest way to get Fable-level output without paying full price.
A YouTube host reverse-engineers Boris Cherny's one-line CLAUDE.md snippet, then runs a live three-way Claude Code test to prove a self-learning lessons file beats a static one.
A three-line prompt that fans Claude out into paired builder and critic sub-agents until every piece clears a stated quality bar — and the one condition that decides whether it helps or hurts.
A content director runs 336 unsorted vlog clips through a Claude Code + DaVinci Resolve Studio pipeline that classifies A-roll from B-roll, proposes cutaway placements against four editorial rules, and drops the picks onto a real timeline — then shows exactly where it still needs a human.