All-day agent loops
Keep a bot working all day by waking on a clock, reading durable state, doing one atomic unit in a fresh session, writing to git, then exiting — not by keeping one session alive.
The inner loop — perceive, reason, act until a task ends — is well understood. All-day autonomy is an outer loop around it. Practitioner writeups and vendor docs converge on the same shape: wake, read durable state, one isolated unit of work, write artifacts, sleep. The scheduler — cron, OpenClaw heartbeat, Claude Code cloud routine, Cursor Cloud Agent trigger — is interchangeable. The pattern that fails tries to remember the day inside one context window.
In-context memory decays within about an hour. The fix is a queue plus filesystem state plus isolated wakes. Sam French’s recipe: SQS long-poll, headless claude -p, git push, email alert — “without TODO.md the agent spins in circles”; “no git push = nothing happened.” SitePoint’s 13-day version uses atomic task files, committed CLAUDE.md, tests as a gate, and a commit after every task so rollback is one git revert. DEV Community’s cron walkthrough keeps state.md under 4 KB because it is injected every iteration. A first-party August 2026 session on the wiki adds a sharper cut on that cold file: a repo AGENTS.md can tell the agent to consult Grok skills without putting those skills on the available-skills list. Instruction is not injection. Cloud Agents walk from /workspace; they do not pick up the operator’s laptop ~/.cursor/rules.
Products versus pattern
Claude Code Routines (research preview, April 14, 2026) saves a prompt, repo, and connectors on Anthropic cloud; each fire is a new session cloning the default branch, with no mid-run permission prompts. Pro plans cap at five routine runs per day; Max at fifteen; Team and Enterprise at twenty-five — so “throughout the day” hits quota before it hits architecture. OpenClaw’s heartbeat reads HEARTBEAT.md every N minutes; default Opus every 30 minutes runs about $15 a day; Haiku every 60 minutes with quiet hours about $0.60. Heartbeat optimizes for cheap “is there anything?” checks. A research queue that drains one entry per wake fits the drain pattern better.
Agents that can verify their own output — run tests, start a server, open a browser — produce dramatically better results than agents working blind. The same August session checks overlay work in the running game on desktop and mobile, and leaves Paper-only chrome (a status bar, a decorative ship) on the canvas. Plan-then-execute coding keeps the human steering the plan while auto-accept handles execution. Parallel Claude workflows assume someone is jumping between tabs; the unattended pattern assumes nobody is. Boris Cherny’s August 2026 maintenance experiment — Slack channel plus daily routines — opened 388 pull requests and merged 180 after Claude Code Review and human review. The human stays at the merge gate.
Official Anthropic, in a June note titled “A harness for every task,” productized a different pattern. Claude writes a JavaScript orchestrator that spawns isolated sub-agents — classify-and-act, fan-out-and-synthesize, adversarial verification, tournament, loop-until-done — on the trigger word ultracode. The authors warn it burns more tokens and is for high-value tasks only. That is scaffolding, not more tabs. Do not collapse it into Boris’s five-to-ten human-tended sessions. The filename of the cold file is now contested at lab level. OpenAI documents AGENTS.md as the instruction chain. Anthropic still ships CLAUDE.md as native. In late August Anthropic said AGENTS.md support was “working on it,” not fetched as shipped. Process can survive either name. The default is unresolved.
Early September added papers and lab instances that sit on the same scaffolding page and do not rewrite those definitions. A fetched Harness-of-Harness abstract reported a 52.25 percent average relative gain after three iterations on named benches — a paper that exists, not a new Anthropic recipe. Anthropic’s September 4 Fermat formalization credited a switch to Prove2Me plus a Claude Code multi-agent harness; early failed runs without that DAG contributed about 7 percent of non-boilerplate lines. Meta’s AIRA₃ agents are “model + coding harness pairs” in isolated environments — the live gold ensemble was GPT 5.5 on OpenCode and Claude 4.8 on Claude Code. Artificial Analysis’s Terminal-Bench 4.0 constituent moved the eval harness from Terminus 2 to mini-SWE-agent. None of that rewrites Harbor’s Terminal-Bench 2.0 table or the June ultracode note.