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?Also calledConvergence, Divergence & Loop Termination

Module
01/05Module
To read
~10 minTo read

It starts with a failure

An AI review agent fixes its own findings in a loop. It is set to work on a tricky sign-in module and to keep going until the code is clean. What do you think happens?

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

  1. 01

    Every loop needs a progress score

  2. 02

    Every loop needs a hard limit on rounds

  3. 03

    Stop early when progress stalls

  4. 04

    Keep a history to catch a repeating loop

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 to paste into the AI you build with (Lovable, Bolt, Replit, Cursor, Claude Code or Codex), a checklist to check what it built, and recommended skills.

  • Seeing what your loop is doing
  • Background jobs and the workers that run them

Field notes on this topic