← All loops · coding · claude-code
Test-fix loop
The full test suite passes twice in a row.
F1 · Goal
The full test suite passes twice in a row.
F2 · Trigger
on push
F3 · Discover
Run the suite; collect every failing test with stack traces.
F4 · Act
Hand each failure to a subagent scoped to the failing module.
F5 · Verify
pytest exit 0, twice consecutively (guards against flakes).
F6 · Persist
Failures log appended to .loop/failures.jsonl for flake analysis.
F7 · Exit
Two consecutive green runs, or 10 cycles (then open an issue).
Cost
~18k tokens per cycle (measured)
Runnable code
/goal all tests pass and lint is clean -- run the suite, fix the first failure, repeat; stop after 10 turns
Adapted it for your stack? Submit your variant →