## Sources

1. [Loop Engineering](https://www.oreilly.com/radar/loop-engineering/)

---

### **Loop Engineering – O’Reilly** by Addy Osmani

**Main Arguments**

*   **The Transition from Prompting to Designing:** The core argument is that the methodology of working with coding agents is shifting from manual, turn-by-turn prompting to **loop engineering**, where developers design systems that manage and prompt agents autonomously [1, 2].
*   **The Shift in Engineering Leverage:** Rather than just using AI as a tool, engineers are now building "small systems" that find work, triage it, execute it, and verify it [3]. This moves the **leverage point** of software engineering from individual prompt craftsmanship to the design of recursive goal-seeking architectures [4].
*   **The Convergence of Tools:** The author observes that leading tools like the **Codex app** and **Claude Code** have converged on the same structural primitives, meaning loop design is becoming a universal skill regardless of the specific platform used [5, 6].

**Key Takeaways**

*   **Definition of a Loop:** A loop is a recursive goal where a developer defines a purpose, and the system iterates until the task is complete [1].
*   **The Five Essential Components:** A successful engineering loop requires five technical primitives: **Automations** (heartbeat/schedule), **Worktrees** (isolation), **Skills** (persistent context), **Plugins/Connectors** (external tool integration), and **Subagents** (splitting the maker from the checker) [7, 8].
*   **The "Sixth Piece" – Persistent Memory:** Because AI models "forget" everything between runs, loops must rely on **disk-based state** (like Markdown files or Linear boards) to track progress and what remains to be done [8, 9].
*   **The Maker-Checker Split:** A critical takeaway is the necessity of **adversarial verification**, where one agent implements a solution while a separate subagent—often using a stronger model or different instructions—verifies the work against a spec [10-12].
*   **Human-in-the-Loop is Mandatory:** Despite the automation, the author emphasizes that "verification is still on you" [13]. Loops can scale mistakes as quickly as they scale fixes, and engineers must avoid **"cognitive surrender"**—the temptation to stop thinking and blindly accept agent output [14, 15].

**Important Details**

*   **Automations:** These act as the "heartbeat" of the system, running on a cadence to summarize CI failures, hunt bugs, or perform daily issue triage [6, 16].
*   **Worktrees:** Using **Git worktrees** allows multiple agents to work in parallel without colliding on the same files, which is essential for scaling AI-driven development [17, 18].
*   **Skills (SKILL.md):** This format allows developers to codify project knowledge, build steps, and historical "incidents" once, so the agent does not have to "rederive" the project's context from zero every time [19, 20].
*   **Plugins and MCP:** Both Codex and Claude Code utilize the **Model Context Protocol (MCP)**, allowing loops to interact with issue trackers, databases, and communication tools like Slack or Slack [21].
*   **The /goal Primitive:** Modern agents now include a specific `/goal` command that continues working across turns until a verifiable condition (like "tests pass and lint is clean") is met, with a separate model grading the result [12, 16].
*   **Economic Considerations:** The author warns that loop engineering requires being mindful of **token costs**, as running multiple subagents for verification and exploration can consume resources quickly [1, 12].
*   **Comprehension Debt:** A significant risk identified is that high-speed loops can create a gap between the code that exists and the engineer's actual understanding of it, potentially leading to a "downward spiral" in quality if not managed [14, 15].