/go-loop — Iteration Loop Closer
Boris Cherny's /go pattern applied to AI media pipelines: when invoked, Claude tests its own work end-to-end, simplifies, commits, and pings you. No babysitting.
The Loop
GENERATE → VERIFY → [regen if FAIL, max 2 passes] → COMPOSITE → COMMIT → NOTIFY
When to Invoke
Invoke at the end of any generation task. Safe to chain after batch generators, direct API calls, or MCP tool calls.
Example prompts:
regen shot-06 with updated prompt /go-loopgenerate remaining CGI shots using approved refs /go-looptry shot-08 variants for energy match /go-loop
Execution
Step 1 — Verify what was just generated
Run your verification script (see the verify skill for a CLIP-based implementation):
python3 scripts/verify.py <ITEM_ID> --json
Read the verdict JSON. If Claude just generated multiple items, iterate.
Step 2 — Regen if FAIL (max 2 passes)
For any item with verdict FAIL:
- Look at
failed_metrics— targeted fix per metric:characterfail → ensure character refs are passed to the generatorpalettefail → check world/palette assignment, enforce palette hint in promptprompt_matchfail → revise prompt wording, tighten focal lengthcompositefail → cross-check frame selection
- Regen via same path. Do NOT burn credits if a prompt fix alone would resolve.
- Re-verify. If still FAIL after 2 regens → surface to user, do NOT continue loop.
Step 3 — Build composite
python3 scripts/assemble.py --composite <ITEM_ID>
Step 4 — Simplify (optional)
Run /simplify on any supporting code Claude wrote (prompt builders, batch scripts, helper utilities). Skip for pure generation work.
Step 5 — Commit
Summary commit with:
- Items touched (IDs)
- Pre/post quality scores
- Regen count per item
- References used
Commit message format:
<item-ids>: <short description>
Quality deltas: shot-06 0.31→0.42 (GOOD), shot-08 0.28→PASS, shot-11 FAIL after 2 regens
Co-Authored-By: Claude <noreply@anthropic.com>
Step 6 — Notify (optional)
Send summary to the user via your preferred channel (Telegram, Slack, email). Format:
/go-loop complete
<N> items verified, <M> regenned
Results:
shot-06: GOOD (0.42)
shot-08: PASS (0.31)
shot-11: FAIL after 2 passes — needs manual review
Composite: runs/composites/latest.png
Commit: <hash>
Only send if the channel is configured. Otherwise skip silently.
Invariants (don't break these)
- Never regen more than 2x per item per invocation. Burns credits; if still failing, the prompt or reference is the issue — hand back to user.
- Never skip verification. The whole point is the tight loop. No verification = no /go.
- Always pass references to the generator. Double-check before regen.
- Respect file locks. If
/lockscenesis active, respect the guard. - If FAIL after 2 passes: stop, summarize, ask. Don't auto-escalate to a different generator without user input.
Output format to user
When /go-loop completes, print a compact summary (no headers, no celebration):
shot-06 GOOD 0.42 (1 regen)
shot-08 PASS 0.31 (0 regens)
shot-11 FAIL — 2 regens, character metric stuck at 0.48
composite: runs/composites/2026-04-16.png
commit: a7b3c9d
notified
Related Skills
verify— the underlying quality gateclip-feedback— for single-clip intent analysisnb2-batch— for batch-generating reference gridslockscenes— for locking approved items during assembly