Skip to content

Tutorial: loop an agent until the work is great

One prompt rarely gives you the best an agent can do. A Loop makes the agent its own critic: work, score, improve, repeat — until the result clears the bar you set.

In the command bar, type a goal with a bar:

Starting a loop from the command bar: “loop: polish the landing page until score 9”

“loop: polish the landing page until score 9” — that’s a goal (“polish the landing page”), a bar (9/10), and Mastery HQ picks the top agent window to run it in.

Open the Loop pane (Tools menu) to watch it think:

The Loop pane tracking passes and scores

Each pass shows the work, the critique, and the score. You’ll see scores climb — 6, then 8, then the bar clears and the loop ends with its best version.

  • Raise the bar: “…until score 9.5” for high-stakes work.
  • Change the critic: add roast (“…until score 9 roast”) for a merciless reviewer, or karpathy for engineering taste.
  • Cap the passes: loops stop at their pass limit even if the bar isn’t met, so they never run away.

Anything with a quality gradient: landing-page copy, refactors, test coverage, a README, pitch decks. If you’d naturally say “make it better” three times, a loop says it for you.

Frequently asked questions

How does the loop know when to stop?

Each pass is scored against your bar (e.g. 9/10). The loop ends when the score clears the bar or the pass limit is hit — whichever comes first.

Can I make the critique harsher?

Yes — add a lens like "roast" for a brutal critic or "karpathy" for an engineering-taste review to the loop phrase.