Appearance
Text size
Typeface
Line spacing
Tips

Loops

One at a time. Tell it whether you knew, and the ones you did not stay in your pile.

1 / 11

Anthropic names four loop types: turn-based, goal-based, time-based and proactive.

Turn-based you steer; goal-based uses /goal; time-based uses /loop or /schedule; proactive runs on events or a schedule with nobody present.

The whole topic11
  • Anthropic names four loop types: turn-based, goal-based, time-based and proactive.

    Turn-based you steer; goal-based uses /goal; time-based uses /loop or /schedule; proactive runs on events or a schedule with nobody present.

  • /loop without an interval lets Claude pick each interval itself.

    /loop 5m prompt fixes it. A bare /loop runs a built-in maintenance prompt, or your loop.md.

  • .claude/loop.md replaces the default prompt of a bare loop.

    The project file wins over ~/.claude/loop.md, and edits apply on the next iteration.

  • To stop a fixed-interval loop, ask Claude to cancel it.

    Esc and Ctrl+C do not stop it.

  • A good /goal is a checkable finish line with a cap.

    The loops post's example is a Lighthouse score of at least 90, capped at five tries.

  • The Ralph loop is a bash while-loop that starts every iteration with a fresh context.

    Each iteration takes one task from a plan file on disk. The plan is disposable: regenerate it when it drifts.

  • Tests, builds and type checkers act as backpressure on a loop.

    They reject bad output so the loop can move fast and still stay correct.

  • In the compiler project an agent killed its own loop with pkill.

    Unattended agents need a loop they cannot reach: run it outside the process they control.

  • A timer alone is not a loop.

    Each turn must look at fresh evidence, or you are just repeating a prompt.

  • A standalone evaluator, out of the box, approved bugs it had found.

    Tune it against your own judgment over several rounds before you trust its "done".

  • The full harness cost 200 USD and six hours; the solo run cost 9 USD and was broken.

    Only use the heavy setup when the gap in quality justifies a cost of over 20x.