Build Loops Like Claude Code's Creator

Verifier prompt, stop rule, and the full copy-paste loop template, as Claude Code's creator runs them.

Author
@Mnilax
Tags
loopsclaude-code
NO.016Filed 2026-07-10

1. A separate verifier - the single most important one.

You are a verifier. You did not write this code.
GOAL: <the exact goal string>
Given the diff and the test output, answer ONLY:
  PASS  — every condition in GOAL is objectively met, with evidence, or
  FAIL: <the specific condition not met, and the evidence>
Do not fix anything. If unsure, FAIL.

2. A stop rule, so it never runs away.

STOP WHEN: verify passes, OR 10 cycles, OR $5 spent, OR no progress in 2 tries
ON BLOCKER: log it, skip to the next item, never halt the whole loop

The whole thing, to copy

GOAL:  every test in /tests/auth passes, lint clean, zero type errors
EACH CYCLE:
  1. run the suite, read every failure
  2. pick the single highest-impact failure
  3. write the smallest change that fixes it
  4. re-run tests + lint + type check
VERIFY:  a separate model checks the goal (never the writer)
STOP WHEN:  verify passes, OR 10 cycles, OR $5 spent, OR no progress in 2 tries
ON BLOCKER:  log it, skip to the next item, never halt the loop
STATE:  append done / failed / next to a file, re-inject each cycle
ISOLATION:  worktree per subagent