Skip to content

Loops: refine until it's good

A loop is Mastery HQ’s quality machine: it takes a goal, has an agent produce a draft, scores the draft with a judge, feeds the critique back, and repeats — until the work clears your score bar or the pass limit hits. You state the destination; the loop does the iterating.

In the command bar (typed or spoken):

loop: write punchy hero copy until score 9

The top-most agent picks it up; the loop announces its terms (“refining until 9/10, max 5 passes”). Or start from work that already exists: every agent window has a Loop this button that turns the last exchange into a loop.

Dial Default In the one-liner
Score bar 8 / 10 “…until score 9”
Max passes 5 (cap 12) “…until 6 rounds”
Lens standard add “karpathy” or “roast” for a different judging personality
Keep the best pass on — (tick box)
Pick the best agent first off — (tick box)

Each pass refines the best-scoring version so far, not simply the most recent one. That matters more than it sounds: without it, one bad rewrite becomes the base for every pass after it, and a loop can spend its whole budget drifting away from something good it already had. A pass that comes back materially worse is discarded, and the agent is told what was wrong with it so it doesn’t take the same direction twice. When a loop runs out of passes it reports its best pass, not its last.

This is on by default. Keep the best pass turns it off if you want each pass built strictly on the one before it, whatever the judge made of it.

Which agent does best is a property of the task, not a standing preference — the strongest model in general isn’t always the one that does best on your particular goal, and a loop has no way to know without asking.

Tick Pick the best agent first and the loop runs your goal once on each open agent window, scores the answers with the same judge that scores every pass, and runs on the winner. The window says who it picked and what everything scored — and says so just as plainly when scouting changed nothing, because a loop that fell back to your own pick shouldn’t look identical to one that compared and agreed.

It’s off by default: it costs one extra agent run per candidate, and it only happens on a loop’s first start, never on a resume.

What good looks like (the strongest dial you have)

Section titled “What good looks like (the strongest dial you have)”

A number on its own is a weak target. Ask a model to score the same work twice and it moves a point or two, so a high bar either drifts upward until it means nothing or never converges and spends the whole budget on noise.

The What good looks like box fixes that. Paste something concrete — a piece of writing you admire, a code sample in the style you want, a spec, a filled-in example — and every reviewer compares the work against that instead of against its own idea of quality. The question changes from “how good is this out of ten?” to “what is still different from this?”, which a model answers far more consistently.

It is optional and it is per loop, not per pass. Leave it empty and loops behave exactly as they always have.

Four ways, and it tells you which one happened:

  • Cleared the bar. A pass scores at or above your bar — and then a second, independent reviewer with a different perspective checks it before it ships. Most rounds are obvious rejections where a second opinion changes nothing, so buying one only at the moment it can change the outcome is what makes a high bar affordable. If the two disagree, the second reviewer’s objection becomes the next critique.
  • Stopped improving. A pass that comes back with no real change can’t score differently, so paying a reviewer for it is waste. The loop switches to a different reviewer instead of asking the same question again; if the pass after that is also unchanged it stops and says so, rather than burning the rest of the budget on a model that has stalled.
  • Ran out of passes. The max-pass count is the backstop, not the plan. What you get back is the best pass of the run, not whichever one happened to be last.
  • You stopped it.

A disqualifying defect overrides the score entirely. A reviewer will give nine out of ten to work containing a real bug or a factual error, because the flaw is small next to everything that is right — so a reviewer can mark it disqualifying and the loop will not finish on it at any score.

A goal that stops improving as one artifact is usually one that should have been several. A stalled loop offers Split into a graph, which hands your goal and your reference to Graph mode, where the work is broken into stages that are built and judged separately. Refine mode stays deliberately simple for the many goals that never need this.

The Loop pane (say open loop) is the whole console: the run’s live picture, its passes, and an All loops list showing every other loop with its pass count and latest score. Stop anytime from either. With no Loop window open, a chip in the bottom-left corner reopens one.

Single task: mechanical work with an objective done-state (“rename this function everywhere”). Loop: anything with a quality gradient — copy, design language, refactoring style, test coverage narratives — where the third pass is reliably better than the first and you’d rather not be the one asking for it three times.

Frequently asked questions

How does the loop know when to stop?

A judge scores each pass against your goal on a 1–10 bar (default 8). The loop stops when a pass clears the bar and a second independent reviewer confirms it, when two passes in a row come back with no real change, when it hits the max pass count (default 5, cap 12), or when you stop it. A defect a reviewer marks disqualifying blocks the finish at any score.