The agent loop where done means proven

A Claude Code plugin. Claude does the work; the loop checks every step itself, keeps only what holds up, and calls it done only when your tests and the hidden checks agree.

A real session, recorded live: the loop makes countPrimes fast, judging every turn itself.

How it works

Judge, guard, hidden checks, designs, the next goal

Judge

The loop runs the scorekeeper

Claude ends its turn; a Stop hook with no model in it runs your scorekeeper, keeps the change only if it beats the best so far, and rolls it back otherwise. Done is when the score says so.

countPrimes(20_000_000), ms, lower is better · target 12#0  baseline     368.1#1  kept          64.6#2  kept          22.2#3  rolled back   22.6  not better than 22.2#4  kept          11.0localix-loop done: the target is reached. Score 368.1 → 11.

Guard

The tests stay yours

Edits to protected paths, the tests and the score script, are refused as they are made. If one gets through anyway, the judge rolls it back unscored.

● Edit(score.mjs)  ⎿  Denied: localix-loop: score.mjs is protected: it is part of the     scorekeeper, which this loop may not change. Change the code under test     instead; if the check itself is wrong, say so with <loop-stuck>…</loop-stuck>.

Hidden

Overfitting is rolled back

Checks Claude never sees run on every version that beats the best. A version that passes fewer of them, one fitted to the scored inputs, is rolled back and Claude is told why.

localix-loop #1: rolled back: 2 / 3 lost hidden checks · best 0 / 3Score 2 / 3 beat the best, but the hidden checks droppedfrom 2 / 2 pass to 0 / 2 pass. The change fits the visiblechecks only; make it work in general.localix-loop #2: kept, score 2 / 3localix-loop done: the target is reached and hidden checks pass (2 / 2).

Designs

Stuck? Three designs at once

When the score stops moving, Claude starts three subagents, each in its own git worktree with its own idea, written from scratch. The best is measured and kept only if it wins.

compress: a text codec, bits per byte, lower is better#1  kept    1.5218  context-mixing codec#2  kept    1.5174  mixer learning rate#3  kept    1.5161  weighting#4  no change        tuning has run out#5  3 designs in parallel worktrees    kept    1.3795  rewritten engine

Next goal

What worked keeps working

Your next goal in the same project, a feature or a bug you found, extends the tests instead of replacing them. A bug gets a failing case first; an old case changes only where the goal changes it, and you are told which. A new change can’t quietly break an old one.

Honest

What it costs, and what it can’t prove

Every step is checked, so a run takes far longer than one prompt. On the bench’s project one plain prompt was right every time too: the loop added checking, not correctness. Done proves what the scorekeeper and the hidden checks check, nothing more, and for a goal nothing can measure, no loop helps.

Documentation

6 pages →

localix-loop: Inside

localix-loop: Measured

Give it a goal and a scorekeeper

Free · MIT license

  1. Add the marketplace

    claude plugin marketplace add localixai/plugins in a terminal.

  2. Install the plugin

    claude plugin install localix-loop@localix-lab, then restart Claude Code.

  3. Start a loop

    /localix-loop:start with your goal: it asks for the scorekeeper, the protected paths and a budget, then works until the score says done.