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
Watch tests while you work
A passive watchdog loop that reruns your test suite every 15 minutes and surfaces failing tests with their error output.
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.
Make all tests pass
Implement remaining code and run tests repeatedly until the full suite passes.