Loop Engineering: Managing Coding Agents Through Loops
Instead of prompting coding agents turn by turn, engineers now design loops that run them autonomously. Here's how Codex and Claude Code implement it.
Loop engineering describes a shift where developers stop prompting coding agents turn by turn and instead design systems that trigger and supervise agents automatically. Figures like Peter Steinberger and Anthropic's Boris Cherny describe writing loops rather than prompts, framing this as a layer above the previously discussed 'agent harness engineering' — the harness defines the environment a single agent runs in, while a loop adds scheduling and self-feeding automation on top.
A working loop relies on five primitives: scheduled automations that discover and triage work, git worktrees that let parallel agents avoid stepping on each other's files, skills that encode project knowledge so it doesn't need re-explaining, plugins and connectors that hook agents into existing tools, and sub-agents that split idea-generation from verification. A sixth element, persistent memory outside the conversation (a markdown file or a board like Linear), is essential since models forget everything between runs and state must live on disk.
The piece notes that these capabilities are no longer custom-built with bash scripts but now ship natively inside products like the Codex app and Claude Code, each implementing the same five primitives under different names — both, for instance, support a /goal command that keeps an agent working until a defined condition is verified by a separate checking model. The takeaway for engineers is that recognizing this shared shape matters more than picking a specific tool, though token costs and human review bandwidth remain real constraints on how far loops can scale.