Skip to content

How do you make sure a loop, like a retry or an agent, always stops, and notice when it is going in circles?

Module
01/05Module
To read
~7 minTo read

It starts with a failure

A self-correcting review agent was set to fix a tricky authentication module, looping until the code was clean. What do you think happened?

In the module you make your guess first, then read what happened and why.

  1. 01

    Every loop must define a convergence metric

  2. 02

    Hard iteration bounds are non-negotiable

  3. 03

    Divergence detection triggers early halt

  4. 04

    Oscillation detection requires state history

SpecA stop plan for one loop

A spec for your own app, as a text file you download. The module also gives you the prompt for Claude Code, Codex or Antigravity, a checklist to check what it built, and recommended skills.

  • Observability
  • Workers and background jobs

Free guides on this topic