← session · LOG ENTRY ·
Loop engineering: running Claude Code sessions that ship for hours
Most people use agentic coding tools like a faster autocomplete: prompt, review, repeat. The unlock is running them as long-lived sessions, hours of autonomous work with checkpoints, and that's a different discipline. Call it loop engineering: designing the outer loop so the agent keeps shipping when you walk away.
The core moves. One: a written definition of done, the loop needs a termination condition it can check itself against, or it either stops early or runs forever. Two: self-pacing instead of fixed polling, wake when an event fires (a build finishing, a review landing), with a long fallback heartbeat, because polling burns context on nothing. Three: background monitors for anything the loop waits on, so silence and failure never look identical, a watcher that only reports success will happily sleep through a crash.
Four: fan-out for research, single-thread for writes. Parallel subagents are superb at reading, audit ten codebases, mine three data sources, run a dozen search queries simultaneously. But two agents writing to the same surface is a merge conflict with extra steps. Gather wide, write narrow.
Five: externalize memory. Long sessions outlive context windows, so anything that matters gets written to disk, plans, baselines, decisions, where the next iteration can re-read it. The session becomes a process with a filesystem, not a conversation. This is the same checkpoint discipline production agents need; it turns out the coding loop and the runtime loop want identical architecture.
What this buys you in practice: entire features built, reviewed by independent models, and deployed while you review the result instead of babysitting the process. The skill ceiling has moved from writing code to specifying outcomes and designing loops that survive contact with reality.
— end of log entry. back to session · handoff to human