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 ↗graded C · 70/100 — how grades work →
More testing loops
Build a REST API with tests
Run autonomous iterations to ship a complete REST API with full test coverage until completion is promised.
Test all endpoints
Run tests against every API endpoint until coverage is complete or you hit 30 iterations.
Hit acceptance criteria
Drive a feature to done against explicit acceptance criteria: a working paginated endpoint, passing tests, clean lint, and a hard turn cap.