Do the same thing until the job is done.
Ten boxes, one trip each, until the last one is across. A loop is that pattern, with the condition written down before you start.
The idea, in ten boxes
You have ten boxes to move from one room to the other. You do not decide ten times whether to continue. You carry one, come back, carry the next, and you stop when the last one is across. The condition was never in doubt, so the work simply continued.
Loop engineering is writing that condition down for the AI: repeat this step, check the result, stop when this is true — not when it feels finished.
The four parts of a loop that behaves
- The step — one job, stated once.
- The check — how it knows whether the step worked.
- The stop — the exact condition, written before the first run.
- The ceiling — a maximum number of attempts, so a confident wrong loop cannot run all night on your money.
A loop I actually run
One instruction, several steps, and it ends with something in my inbox instead of a chat reply I have to remember to read.
What this prompt is for: turning a repeatable chore into one instruction — fetch, save, summarise, email. Give it a stop condition and a ceiling so it cannot run all night.
Do this every time I give you a topic: 1. Find the content — from the sources I named, not from your memory. 2. Write it into a Google Doc in my Drive, inside the folder "Inbox", dated in the title. 3. Add a three-line summary at the top: what it is, why it matters to me, what to do next. 4. Email me the link with the summary in the body. 5. If a source fails, say which one failed and give me what you have. Do not fill the gap. Stop when the doc exists and the email is sent. Maximum 3 attempts per source.
Where it goes wrong
- No ceiling. The most expensive bug in AI work is a loop that never terminates and keeps billing.
- A stop condition the model can satisfy by lying. "Stop when the score is above 9" invites a fake score. Which is exactly the next page.
- A loop that repeats without learning. If each pass does not change the input, you have written a spin, not a loop.