The practical guide to designing AI loops that stop only when a real check passes.
A useful AI loop has a goal, the context it needs, an action it takes, a check on whether the action worked, and a retry rule if it failed.
What result should exist?
What must the agent read first?
What does it do?
What proves it worked?
What happens if it fails?
Goal: [specific output]
Context: [files, data, rules, examples]
Action: [what the agent does]
Verifier: [lowest check that proves the output is valid]
Retry: [max attempts + what changes each retry]
Stop: [time, spend, attempt, or human gate]Verifiers sit on a ladder from dumb and certain to smart and arguable. Your goal is to stay as low as the task allows.
Use this when the loop's first promise is simple: create a report, export a CSV, write a summary file, produce an invoice, save a screenshot.
test -s deliverables/report.htmlThis does not prove quality. It proves existence. That is still better than accepting the agent's word.
Best for content and knowledge work where quality is graded. The score must clear a hard line before output moves forward.
Best for code, security, data integrity, and anything where one failure should block shipping.
Known input, known steps, known check, clear stop condition. Start here.
Each morning:
1. Read inbox notes
2. Extract tasks
3. Rank by deadline and value
4. Verify every task has an owner and next action
5. Stop after one daily plan is writtenBroad goal, fuzzy finish line, lots of exploration. Useful, but expensive and harder to trust.
Bad: Research the market until you find something interesting.
Better: Find 10 recent examples, discard dead links,
score each against 5 criteria, and stop.A self-running system can produce more than you can read. That feels productive until you approve work you no longer understand.
Review a random sample from every loop run, even when the gate passes.
Keep the verifier rules in a human-owned file the agent cannot quietly rewrite.
Set max attempts, time, spend, or tokens before the loop starts.
Write restart, replay, and rollback instructions before the first unattended run.
Loop name:
Owner:
What it may change:
What it may never change:
Max attempts:
Max spend:
Verifier:
Human gate trigger:
Rollback path:
Last spot-check date:Pick one repeated task with a clear output.
Write the loop skeleton: goal, context, action, check, retry, stop.
Choose the lowest verifier rung and write the exact check.
Add the context pack: files, examples, rules, and source data.
Run once with a human gate. Record every failure.
Turn the failures into rules, tests, or checklist items.
Run again with a cost cap and spot-check the output.
Use the companion skill when you want a reusable Plan, Work, Review, Triage, Learn loop.
Get the skillStudy a real binary gate in code: PROVEN, NOT_PROVEN, or INCONCLUSIVE, backed by artifacts.
Open GitHubThe playbook gives you the loop discipline. Second Brain 2.0 gives you the configured repo, memory layer, specialist agents, and tool setup to run it every day.
The complete Claude Code system. 30+ agents, memory that compounds, pre-configured MCPs.
DIY $197 / Kickstart $597 / DWY $2,497
See PackagesThe memory layer your loop writes lessons into. Patterns persist and recall across future sessions.
Free / Standard $199/yr / Pro $349/yr
Get MemoryOS