Why Agentic Loops Nail Throwaway Code but Fail at Code Meant to Last
A new pattern is taking over agentic engineering: the harness-level loop. Instead of prompting a coding agent directly, developers wrap it in an outer loop that queues work, lets a machine attempt it, and then decides whether the attempt actually counts as done. If not, the harness reinjects context, spins up a fresh session, or hands the task to another machine — keeping work alive well past the point where the model itself would have declared victory. Armin Ronacher distinguishes this from the familiar inner agent loop (call tool, read result, edit, test) and argues the outer loop is now what dominates both real workflows and the surrounding hype.
His core reservation is about code he intends to keep. Current models, he argues, write code that is too defensive and too locally reasoned: they pile on fallbacks instead of making bad states unrepresentable, duplicate logic, and invent weak abstractions. Citing Karpathy’s line that models are ‘mortally terrified of exceptions,’ he notes the right fix for systems with real invariants — persisted formats, core infrastructure — is to make malformed states impossible, not to handle every one of them. Loops amplify the problem: each iteration adds another small local defense, so the system grows more robust-looking and less comprehensible at once. He claims hands-off setups today produce worse code than more human-in-the-loop workflows did a year ago, precisely because the agent now runs uninterrupted for half an hour at a stretch.
Where loops shine, in his view, is anything that transforms existing code or produces artifacts with a short shelf life: language ports (Bun’s Zig-to-Rust work, his own MiniJinja-to-Go port), performance searches that try-benchmark-discard, security scanning, and open-ended research. These succeed because the output is mechanically verifiable or disposable, and the harness only needs a ‘useful enough’ signal — often another LLM acting as judge — to justify the next iteration, not an objective binary test. The deeper shift he flags is philosophical: engineering is drifting from software-as-deterministic-machine, where invariants are known and code is meant to be understood, toward software-as-organism that we diagnose by symptom like doctors. LLM loops push that drift much harder and faster, and Ronacher isn’t yet ready to apply them to code he has to be able to explain.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.