Give your agent a loop.
An agent loop repeats a simple cycle — do the work, check it, go again — until it hits a clear stop. It's how an agent finishes a job instead of attempting it once. Learn the idea in two minutes; run your first loop in ten.
The shape is simple: do the work, check it, go again — until it's done.
The check is the whole trick. It's what turns "an agent trying repeatedly" into "an agent you can walk away from": the result of the check — not your attention — decides whether the loop continues or stops.
Loops stop for three reasons: the check finally succeeds, the agent needs your input, or it runs out of the budget you gave it.
Serious loops write down each cycle — what ran, what the check said, why it stopped. That log is how you trust work you didn't watch.
Run one in ten minutes.
Start with a tiny task whose check is red, give the agent a small budget, then come back and verify the stop yourself.
- Copy the starter task.Use the checked starter folder from the quick start.
- Paste one prompt.Give the agent the job, the check, and a three-try budget.
- Run the check yourself.Trust the loop because the final command is green, not because the transcript sounded confident.
See a real run.
Every example on this site links to the log of a real run. Here's the one from the ten-minute loop.
## Pass 1 — 2026-07-10T17:12Z → 17:13Z
- run: qs1-first-task-loop
- state read: clean scratch copy of examples/quick-starts/starter-task; initial check output from `bash check.sh`
- did: changed `status.txt` from `status=todo` to `status=done`; 1 turn, 3 shell/file actions
- check: `bash check.sh` → green
- evidence: initial output was `starter check red: expected status.txt to contain exactly 'status=done'` with `actual: 'status=todo'`; final output was `starter check green: status=done`; diff recorded in examples/quick-starts/qs1/final.diff
- state written: examples/quick-starts/qs1/2026-07-10-pass-log.md and examples/quick-starts/qs1/final.diff
- verdict: done