Agent Loops Are Task Queues, Not Magic Autonomy

articlevideoaiagent-loopsworkflow-rigcode-reviewreliability

backs joelclaw's workflow-rig bias toward bounded task queues, state files, reviewer gates, and rollback-aware deploys over open-ended agent autonomy

NeetCode’s video is a useful cold shower on the current loop engineering hype: people are saying Claude Code, OpenAI Codex, and multi-agent coding should be driven by loops now, but the concrete version is mostly boring in the best way: scheduled work, task queues, isolated Git worktrees, reviewer passes, and a state file.

The useful bit isn’t “prompts are dead.” It’s that open-ended while-loops are where agent work rots. A bounded for each over bug reports, pull request comments, failing CI, or migration files is legible. A forever loop with weak checks compounds errors. The video points to Armin Ronacher finding review loops more reliable than implementation loops, and to Jarred Sumner framing loops as better around a task queue than an unbounded while loop.

That maps cleanly to joelclaw: the thing to steal is not the posture, it’s the shape. Queue family → worker → isolated worktree → reviewer/judge → GitHub PR or deploy gate → state receipt. The Google rollback point matters too: if agents land changes faster than production can detect failure, rollback stops being a safety valve and becomes another pile of conflicting state. The system needs backpressure, not self-congratulating slop.

Key Ideas

  • Agent loops are clearest when modeled as bounded task queues, not mystical autonomy.
  • A for each loop over known work items is safer than an unbounded while loop that keeps mutating code until vibes improve.
  • State files, Linear tickets, or Markdown receipts are the spine of resumable agent work.
  • Review loops are a stronger default than implementation loops because AI code review can catch, group, and re-check issues without owning the whole change.
  • Parallel agents need isolation through Git worktrees, explicit acceptance gates, and human-readable progress, or they just create faster messes.
  • Deployment speed has to stay below detection speed, or rollback becomes much harder once multiple agent-written changes stack on top of each other.