Verification-gated self-running loop skill
A drop-in Claude Code skill that keeps looping until an external verifier passes — not the model's own self-report — making it a strong anti-reward-hacking pattern for autonomous coding.
Implementation note
When to use: any autonomous loop where you have been burned by the agent declaring victory prematurely — the model reporting done while the actual checks fail is the classic reward-hacking failure of self-directed loops. How it works: a drop-in Claude Code skill implementing a self-running loop whose continuation logic is gated by a real, un-foolable verification step: the loop continues until an external verifier passes, not until the model's self-report says things look good. The verifier is code the model cannot argue with — tests, builds, whatever objective check you wire in — which structurally removes the incentive to describe success instead of achieving it. Safety: the external-verifier gate is the anti-reward-hacking rail and the entire design point. Its guarantee is exactly as strong as the verifier you supply, so invest in that check; a weak verifier resurrects the original problem one level down. Add an iteration cap alongside it.
Source: selmakcby/loop-engineering ↗
More testing loops
Stabilize flaky tests for good
Measure the flakiness, fix one root cause at a time, and stop after a defined streak of stable full-suite runs.
Build a todo CLI app with tests
Ralph autonomously builds a todo CLI application with comprehensive test coverage over multiple iterations until complete.
Kill flaky tests
Run your test suite repeatedly, collect every intermittent failure, and fix or quarantine flaky tests until you get five consecutive green runs.