Backlog-clearing loop with a separate verifier

The four-settings loop template: a separate verifier model that never shares context with the writer, a hard stop rule, a state file re-read each cycle, and worktree isolation. Point it at a checkable backlog and let it run overnight.

prompt
→ Claude
GOAL: every test in [/tests/TARGET] passes, lint is 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 instance checks the goal — never the writer. Verifier prompt: "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." STOP WHEN: verify passes, OR after 10 iterations, OR $5 spent, OR no progress in 2 attempts. ON BLOCKER: log it, skip to the next item, never halt the whole loop. STATE: append done / failed / next to a state file, re-read it at the top of every cycle. ISOLATION: one git worktree per subagent.
claude-code

Implementation note

Near-verbatim from the source article's copy-paste template (structure and verifier prompt verbatim; target path parameterized). The verifier-never-shares-context split is the load-bearing setting: the writer is optimistic, the verifier is skeptical. Source claims ~340 cycles/7 days at ~$2.30 per accepted change; treat the numbers as anecdote, the shape as sound.

Source: Mnilaxgraded A · 95/100 — how grades work →

More testing loops

Ralph a test backlog

Iterate over a prioritized list of untested modules with fresh context each pass, writing real behavioral tests for one module at a time and banking lessons in a guardrails file.

prompt
→ Claude
/loop each iteration with fresh context: read .ralph/test-backlog.json and .ralph/guardrails.md, pick the top unfinished module, write behavioral tests for its public API (no snapshot-only tests), run the suite, and mark the module done only when its tests pass and coverage for it exceeds 80%; append any discovered testing gotcha (fixtures, mocking rules, async traps) to .ralph/guardrails.md; stop when the backlog is empty or after 25 turns

Test all endpoints

Loop/goalGitHubB

Run tests against every API endpoint until coverage is complete or you hit 30 iterations.

prompt
→ Claude
/goal all endpoints tested or stop after 30 turns
testingmedium riskclaude-code

Ship avatar endpoint to spec

Loop/goalGitHubBnew

Build and test a new /users/:id/avatar route until it passes tests, lint, and matches the OpenAPI schema.

prompt
→ Claude
/goal until grep -q "users/:id/avatar" src/routes/users.ts AND pnpm test -- tests/integration/users.avatar.spec.ts passes AND grep -q "/users/{id}/avatar" openapi.yaml AND pnpm lint passes, or stop after 15 turns
testingmedium riskcursor