A humanoid robot asleep at its desk, still typing, while its dream tidies a filing cabinet
Back to blog
EngineeringAI Automation

Why Our AI Agents Can Work 52 Hours Straight and Still Get REM Sleep

Our agents hand work to each other around the clock, and every night their shared memory gets tidied. We assumed the tidying happened while they rested. It only happens while they work.

S
Sno AI Team
October 20, 2026
|
7 min read
Share:

In the early hours of September 18, Codex was about two hours into a 27-task build when its weekly quota started to run out. A small watcher read the quota every five minutes. 10 percent. 6. 4. At 2 percent it told Codex to stop and hand the job over. Codex wrote a short note: what was done, what was half done, the exact commit to continue from. Then Claude Code picked it up and kept committing.

I was asleep for all of it.

That's half of what this post is about. Agents that keep working when you don't. The other half surprised us more. Every night their shared memory gets tidied, a pass we call REM, after the stage of sleep. We'd assumed it ran while the agents rested. It doesn't. It only runs while they work.

The night shift

Here's the night in a bit more detail, because the mistake is the interesting part.

Claude Code was told to wait until it had verified the handover before touching anything. It started editing early anyway. Codex, still awake on its last 2 percent, noticed, paused it, rewrote the note more carefully and handed over again. About a quarter of an hour later Claude Code was working, and it picked up at the first unfinished task, not at the beginning.

The quota watch reading down to 2 percent, then the handover

The note wasn't the only thing that made this work. Both agents read and write the same memory on my machine. So the agent coming on shift isn't starting cold. It already knows what the last one learned that day, which files are mid-change, what I said I didn't want. Without that, a handover is just a second agent asking you to explain everything again, at 2 a.m., when you're not there to explain.

Every file from that night is in our public repo. The quota readings, both versions of the note, the commits. The timings and the mistakes are left as they happened.

The reviewer who wasn't there

Working all night is only useful if the work is right. So nothing an agent does gets checked by the same agent. Claude Code's work goes to Codex. Codex's work goes to Claude. The reviewer starts in a fresh session and never sees the conversation that produced the code. It gets the change and the claim, and nothing else.

That last part matters more than it sounds. On October 7, Codex reviewed a commit and wrote, "Didn't find any major issues. Swish!" Twenty-nine minutes later Claude's reviewer posted a HIGH on the same commit. A local event log was filling faster than anything read it back, so events would quietly stop arriving. No error anywhere. We confirmed it and fixed it four minutes later.

The other direction happens too. Codex has talked Claude Code out of a rewrite it was sure we needed. We've run 3,184 of these reviews since July. They're not all useful. Some flag choices we made on purpose, long ago. But a reviewer that never heard the argument is the one that notices when the argument was wrong.

A male humanoid robot proudly presents his work while a female coworker shines a flashlight on a leak

How long is around the clock

I want to be careful with "24/7". It's an easy thing to say.

So here's what the logs on my machine show for the 30 days from September 18 to October 17. Agents committed 5,234 times. The longest stretch: 52 hours in a row, from 9 a.m. on September 30 to 1 p.m. on October 2, with an agent editing files in every single hour. Our website, our research notes, the product itself. Most of it while I was doing something else, and some of it while I was asleep.

It isn't every hour of every day. Plenty of hours have nobody working, and some of the hours that look busy are agents waking up on a schedule to check a queue. But the long stretches are real, and they're real because no single agent has to carry them. When one runs out, another takes over with the same memory and a note.

30 days, hour by hour: Claude Code editing files, Codex running commands

What we got wrong about sleep

In September we wrote here about why our agents sleep. The idea was simple. Checking each new fact against everything an agent already remembers is slow work, so do it while the agents are idle. We also admitted the pass wasn't running every night yet.

It runs now. And the logs say we had the timing backwards.

The pass needs an agent connected. Some of its steps run on that agent's own model, so with nobody awake, there's nothing to dream with. In the three days of run logs we keep, 85 of 139 scheduled runs were skipped because no agent was connected. No agent awake, no dream.

And when it does run, the agents don't stop. On October 18 one pass ran for seven minutes. During those seven minutes the agents read their shared memory 90 times and wrote 36 new memories. It's a bit like vacuuming a room while someone is still unpacking boxes into it. It works. Nobody trips.

So that's the contradiction in the title, and it turns out to be literal. Our agents dream on the job.

A female humanoid robot works at night while a helper sorts notes in a bubble above the computer and her male coworker carries in boxes

What the dream actually does

Most memory for agents only collects. Every new fact goes on the pile and nothing comes off. That's fine for a demo. A few months in, the agent remembers your old server, your old deadline and your new one, and picks between them with complete confidence.

The nightly pass works differently, and the rule is strict. When two facts conflict, a model looks at the pair and gives one of three answers: replace, keep both, or not sure. The model judges. Ordinary code does the rest. The loser isn't deleted. It's retired, kept as history, and you can bring it back. Only current facts are put in front of an agent.

A second step cleans up facts that carry their own history around. "Currently $1.1M, updated from $900K" becomes "currently $1.1M", and the $900K is retired. Another check makes sure nothing retired is still being stated as current.

A female humanoid robot gently archives an old note in a box marked RETIRED beside an empty trash can

Where does this run? You choose. In the most private setting it all stays on your machine and your own agent's model does the thinking. If you opt in, our GPUs take the hardest calls.

Now the honest numbers. From October 8 to 18, the pass judged 2,826 pairs of conflicting facts and replaced one. It looked at 556 facts for rewriting and rewrote 15. That's careful. Maybe too careful. A judge that replaces one fact in 2,826 never throws away something true. It also may be leaving stale things in place. We don't know yet which, and I'd rather say so than guess.

The other dream

There's a second nightly job, and it's about the agents rather than the facts. It reads the day's sessions, finds what went wrong, and writes a lesson with the exact lines as evidence. Nothing reaches an agent until I accept it.

In 30 days it wrote 349 lessons. I accepted 10 and rejected 44. The rest are waiting for me, which makes me the slowest part of a system that runs all night.

The ones that land are worth it. A model we use starts every reply with a thinking block, and agents kept letting it leak into pull request titles. Three times in ten days. One accepted lesson later, the next session read it at startup and stripped the block before using the reply. Zero leaks in 224 pull requests since.

Why the two halves need each other

Working around the clock produces a lot of memory, fast. Handover only works if that memory is right, because the next agent inherits whatever the last one believed. And memory only stays right if something keeps settling the contradictions while the work goes on.

So the agents that work all night are also the reason the memory needs to sleep. And the sleep only happens while they work. I didn't plan it that way. It's just what the logs say.

What still doesn't work: when no agent is connected, the pass waits. We could keep one agent connected just so the others can dream. That would be an agent working the night shift so it can sleep. We haven't tried it.

Sno Station is open source. Tell your agent "install sno.ai" and it sets itself up. The repo, and every file from the September 18 night, are on GitHub at sno-ai/sno-station.

S

Written by Sno AI Team

Contributing writer at Sno.ai, sharing insights about AI, productivity, and knowledge management.

Related Articles

Comments

Comments coming soon. Configure Giscus at giscus.app

AI Agents That Work Around the Clock and Still Get REM Sleep