This is a deliberately specific post. If you’ve read the Loop Engineering field guide (Control Systems), you already know the universal anatomy of a feedback loop — measure, compare, correct, repeat. That same anatomy runs underneath every modern agentic-AI coding system. The plant is the development environment (codebase, build system, tests). The sensor is whatever feeds the agent context back. The controller is the LLM. The verifier is the part most teams underbuild. And the catastrophic failure modes — burning hundreds of thousands of tokens in circles, broken plans, tool-call cascades — are all explainable in loop-engineering terms.

This guide is the working tour of that craft. It is the natural companion to the Why Agentic AI Fails and Production Playbook series — those documents argue for verification as the missing architectural piece, this one zooms in on the loop and asks how to engineer each part of it.

What it covers

Twelve sections, about twenty-six minutes of careful reading.

§ 1 — The agentic coding loop, drawn. The block diagram. Gather context → model reasons → tool acts → verifier checks → repeat. The two interactive figures in the hero let you watch the loop run and stall.

§ 2 — Why the model is not the bottleneck. The counterintuitive headline. The loop converges or diverges based on the verifier, not the model. A weak model in a well-engineered loop outperforms a strong model in a poor loop, over and over again.

§ 3 — Context — the input to every iteration. What the agent sees at the start of each loop turn. The retrieval problem. The compaction problem. The “what context did the agent need that it didn’t get” diagnostic.

§ 4 — Action — the tool call. The model’s output that actually does something. Why typed, narrow tools beat broad, free-form tools. The cost of a misfire.

§ 5 — Verification — the missing block. The single most important engineering investment. What “verifier” actually means in a coding context (run tests, check diff size, look for compile errors, sanity-check output structure). Why almost every published agentic system underbuilds this.

§ 6 — The two interactive labs. Drag the verifier strictness and watch the loop converge or thrash. Drag the model fidelity and watch how little it matters compared to the verifier.

§ 7 — Loops within loops. The nested architecture. Inner loop: tool call → tool result → next reasoning step. Outer loop: full task → review → revise. Even-outer loop: PR → code review → merge. When to nest and when to flatten.

§ 8 — Termination — when to stop. The exit conditions that work. Token budgets. Step budgets. Convergence detectors. The did this iteration actually change anything check.

§ 9 — Bandwidth & latency trade-offs. What you gain by running the verifier more often and what you lose. The control-engineering parallel (cross-reference to Loop Engineering).

§ 10 — Observability. Tracing the loop so you can debug it. The minimum logs you need. The trace viewer that turns “this agent went off the rails” into something diagnosable.

§ 11 — The dozen practical rules. Hard-won field notes. Cap your loops aggressively in development. Log the diff at every step. Run the verifier before committing to the next action, not after.

§ 12 — Further reading. The papers and write-ups that have actually changed practice in this corner. Anthropic’s claude-code design notes. The Aider documentation. The handful of independent voices.

Read it

Open the field guide →

The field guide lives at its own URL with a warm-paper editorial layout — violet for the model, orange for actions, blue for context. Two interactive labs showing the loop converging and failing.


← Back to Autonomy