Koda Dojo
· Claude Code

Module 13: Auto Research Loops

Self-driving optimization instead of hand-tuning: measure-change-remeasure loops that grind a metric toward a target while you do something else.

Lessons

  1. Three loops, one converges. Predict which of three specs converges and run them all. Then build a spec that converges from parts of the three.
  2. One pass, six steps. Put the six steps of one pass in order and play it. A step out of place shows what it depends on.
  3. Read the loop contract. Flag the lines of a loop contract that break the loop, then run the afternoon on it.
  4. The loop that ran all night. Diagnose a night where nothing changed, then set the grant, the cap and the halt on loop.sh and run it again.
  5. The number is the verdict. Referee five passes and the proposed sixth, then run the ratchet and watch the best-so-far bar.
  6. Fresh check. A case you have not seen: three plugin eval tables. Pick the honest reading of each. Your first result is kept.

What you take away

  • A loop needs a metric, a change method, and an assessment; with all three in place, it runs itself
  • Qualify metrics ruthlessly: numeric, unambiguous, re-measurable in under 60 seconds
  • Commit before every iteration and revert regressions instantly; the log of failed attempts is data, not waste
  • Declare the stop condition before iteration one: a target or a max count, whichever comes first
  • The measured number is the verdict; never accept the model's narrative of improvement in its place

Field exercises

  • Build a Self-Correcting Bug-Fix Loop
  • Grind Lint Errors to Zero With a Category Loop
  • Build the Loop Harness: a One-Number measure.sh Contract
  • Run a Lighthouse Performance Optimization Loop
  • Build a Test Coverage Ratchet
  • Run a Karpathy-Style Iterative Research Loop
  • Run an Unattended Loop With Headless Mode
  • Qualify Your Own Metric and Loop It on Real Work
  • Build an Auto Research Loop Agent
  • Build a Self-Verifying Auto Research Loop
  • Keep Run Evidence and Encode Real Lessons in a Ledger

All fifteen modules of the Claude Code Dojo