The Shift from Prompting to Loop Engineering
Loop engineering represents a fundamental shift in how developers interact with coding agents. Instead of a manual, turn-based interaction where a human prompts an agent, developers now design autonomous systems—loops—that manage the discovery, execution, and verification of tasks. The goal is to move from being the agent's operator to being the architect of the system that directs it.
The Six Primitives of a Functional Loop
To build a robust, self-sustaining loop, you need six core components that ensure the system can operate without constant human intervention:
- Automations: The heartbeat of the loop. These are scheduled tasks that handle discovery and triage (e.g., scanning CI failures or issue trackers) and trigger the agentic workflow.
- Worktrees: Essential for parallel execution. By using
git worktree, you isolate agent tasks into separate directories, preventing file collisions when multiple agents work on the same repository. - Skills: A repository of project-specific knowledge (stored in
SKILL.mdfiles). This prevents the "goldfish effect," where agents lose context between sessions, and allows you to codify project conventions and constraints. - Plugins and Connectors: Using standards like MCP (Model Context Protocol), these allow agents to interact with external tools like Slack, databases, or issue trackers, moving the agent from a local file-editor to a system-integrated worker.
- Sub-agents: A structural necessity for quality control. By splitting the "maker" (the agent writing code) from the "checker" (a separate agent verifying the code against specs), you reduce the risk of the model grading its own homework too leniently.
- State Management: The "spine" of the loop. Because models are stateless between runs, you must maintain state on disk (via Markdown or tools like Linear). This allows the loop to resume where it left off, tracking what has been attempted and what remains.
The Human Responsibility: Avoiding Cognitive Surrender
While loop engineering increases leverage, it does not remove the human from the loop. It introduces three specific risks:
- Verification: An autonomous loop is an autonomous error-generator. "Done" is a claim, not a proof; the developer remains responsible for confirming the code works.
- Comprehension Debt: As the loop ships code faster, the gap between the codebase and the developer's understanding grows. If you do not review the output, your mental model of the project will rot.
- Cognitive Surrender: The temptation to stop having an opinion and blindly accept agent output is high. Loop design requires more judgment than prompt engineering, not less. The loop is a tool for acceleration, but it becomes a liability if used to avoid thinking.
Ultimately, the leverage point has moved. The engineer's job is no longer to write the prompt, but to design the system that ensures the loop is acting with the same rigor as a human developer.