Back to resources
AI & machine learningx.com/AnatoliKopadze

Loops explained: Claude, GPT, Mira and what actually works

What an AI loop actually is — goal, verifier, state, stop — when it pays off, how Claude Code runs one, and why a loop without a gate just burns tokens.

by Anatoli Kopadze (@AnatoliKopadze)

Most people still drive a model one prompt at a time. This article is the clearest map I have seen of the other mode: a loop — a goal, a verifier that can fail the work, state so it does not repeat the same mistake, and a hard stop. Skip the verifier and you just have the model grading its own homework.

Kopadze is useful because he draws the line most loop posts skip. Build one only when the task repeats, something can reject bad output automatically, the agent can finish the job end to end, and "done" is objective. Miss any of those and a single good prompt is cheaper. He also names the cost trap: each pass re-reads a bigger context, so the metric that matters is cost per accepted change, not tokens spent.

The second half is a product pitch for Mira. The first half is the part I keep — verify, keep state, cap the run, and only automate after it works by hand.

Open resource
Loops explained: Claude, GPT, Mira and what actually works | Ender Puentes