Skip to main contentTailor AI LogoTailor AI
    Engineering Blog
    Agentic Coding3 min read

    Loop Until a Critic Says It's Good

    Greg Bayer
    Greg Bayer

    CEO & Co-founder

    Loop Until a Critic Says It's Good

    The most useful prompt pattern we found this month is a loop with a judge in it.

    The shape is simple. Ask for the work, fan it out to subagents, then give one more subagent a single job: tear the result apart. Not "review this." Be a harsh critic. Loop until it stops finding things.

    A prompt making the rounds on LinkedIn, for building a first-person shooter in ThreeJS, makes it obvious:

    > Fan out sub-agents and have sub-agents tackle each one individually. You should loop on each item and have a separate sub-agent check it visually. That separate sub-agent should be a really harsh critic, and if it doesn't look triple A, it should keep going. Don't stop until each sub-agent is utterly wowed with the quality compared with the actual game. It should literally compare them side by side blind and say which one looks better.

    It's a silly example of a serious pattern. Three things in there do the work.

    The critic is a different agent

    An agent grading its own output isn't a critic. It already decided the work was good, which is why it produced it. A fresh agent with no stake in the previous answer finds things the author can't.

    The bar is a comparison, not an adjective

    "Make it high quality" gives the critic nothing to measure. "Compare it side by side against the real thing and say which is better" produces a verdict that's hard to fudge. Blind, so it can't defer to the thing it made.

    The exit condition isn't a count

    Not "iterate three times." Keep going until the critic stops objecting. You don't know the number of passes in advance, so don't pretend to.

    Ours is less dramatic

    A blocker-only reviewer runs alongside every push, reading the diff and reporting only things that should stop a merge.

    It caught two real bugs in the commit that introduced it, reading its own diff on its first run. The better one: a stale report file from a previous branch would get harvested and its findings attributed to the current branch, at line numbers belonging to entirely different code.

    That's the argument for the pattern in one story. The author of that code was an agent that had just been told to be careful. What caught it was a second agent with a narrow mandate and no attachment to the work.

    Two ways it fails

    A critic with a vague mandate approves everything. Ask "does this look good" and you get yes. The mandate has to name what counts as a blocker and give the critic explicit permission to keep saying no.

    The subtler one: a critic that can write. We forbade ours from touching anything but its report, then found the wording was ambiguous enough that an obedient agent would write nothing at all. The harvest step keyed off the agent reporting rather than the file being fresh, so it would read whatever the last branch left behind.

    Loops with judges in them are worth the setup. The mandate has to name what counts as a blocker, and permit nothing except the report.