Loop Engineering: Build the Loop, Don't Feed the Agent
AI coding tools now run unattended loops that verify and iterate their own output, so the developer's job shifts from writing prompts to designing stop conditions, review bandwidth, and state files. The cost structure changes too: loop-driven agents can burn 4-15x more tokens, and debugging a 47-round state machine is far harder than fixing a prompt.
Loop Engineering replaces the human while-loop of prompt-review-repeat with a system the developer designs once. A loop auto-schedules starts, isolates work in git worktrees, reads project conventions from SKILL.md files, reaches out through MCP connectors, and has a separate model judge whether each round's output passed. The judge model is the trust mechanism: the coding agent never grades itself.
The paradigm sits atop four layered generations of AI engineering: prompt, context, harness, and loop. Skipping the first three amplifies problems instead of solving them. Not every task deserves a loop; five conditions must hold, from clear triggers and credible context to controlled actuators, verifiable results, and explicit stop conditions. The costs are real: loop mode can burn 4-15x more tokens than chat, debugging a 47-round state machine is 10x harder than fixing a prompt, and loose constraints trigger Overbaking where the AI adds features or deletes tests. The practical advice is to start small with /goal before adding scheduled triggers and tool connectors.
A judge model separate from the implementer, rather than self-assessment, is what makes unattended loops trustworthy.
A cron script that calls an LLM without checking its own output is merely token burning; the loop's value lies in verifying results, not just repeating calls.
As loops run smoothly, understanding debt grows: the gap between what the codebase contains and what the developer genuinely comprehends widens, and two people can run identical loops with opposite outcomes based on whether they use it to deepen understanding or escape it.
SKILL.md and MCP are portable across Claude Code and Codex, so the durable artifact is the loop design, not the tool choice.