CoreWise Academy

Agents & Automation · Layer III / Practitioner

Loop the agent until the work passes

A rerun loop makes the agent redo its own work until a check passes. Script the repetitive half of a skill, end it with a pass or fail verdict, wrap both in a loop, and keep a human at the checkpoints where errors are expensive.

Nº 029 · Vol. I·6 min read· Updated July 2026

Read firstExpertise you can install (Introduces the skill files this guide turns into loop parts.)
“a loop needs a verdict it can act on”

Most people run an agent like a single-lane road: send a prompt, wait, review, send the next. Austin Marchese, who builds client systems on Claude all day, runs his the other way: the agent reruns its own work until a check says it passed, and he stands at the checkpoints. Getting there takes three small upgrades to a skill you already have, in order.

01Script the repetitive half

Every skill contains two kinds of work.

Judgment work: deciding, classifying, writing. The model is the right tool, because the input is different every time.

Repetitive work: fetching, converting, filing. The same steps in the same order every run. Left in the skill’s instructions, the model re-derives them each time, which costs tokens and invites drift.

The upgrade: have the model write a script for the repetitive half once, then make the skill call that script. Austin’s giveaway skill shows the split: a script pulls all new YouTube comments (identical every run), then the model classifies which ones qualify (judgment). A script does the same thing every single time, which is exactly what the repetitive half needs.

While the skill matures, keep a running list of the mistakes the agent makes with it, written into the skill file itself, and let the list grow with use. That habit, applied to a whole codebase, is Turn repeated fixes into rules.

02End the skill with a verdict

A typical skill reads like a recipe: do this, then this, then adjust that. A recipe tells the model what to do and tells nobody whether the result is any good.

Add a final verification step that ends in an explicit verdict: pass or fail, stated as such. A skill that reviews a draft against your writing voice should end with “pass, this reads as you” or “fail, and here is why,” on top of whatever edits it suggests.

The verdict looks cosmetic and is the load-bearing part. A human can read suggestions and decide; a loop can only act on pass or fail.

03Wrap both in a loop

“I don't prompt Claude anymore. My job is to write loops.”

Boris Cherny, creator of Claude Code, quoted by Austin Marchese, “17 Tricks To Build 10x Faster with Claude” · 15:47

A rerun loop is a system that repeats a task until a goal is met. Every one has four blocks:

BlockWhat it isWhere you built it
TriggerWhat starts the loop: you typing a command, or a scheduleAutomate a workflow as a Claude routine
ExecutionThe skill that does the taskSection 01, scripts and all
VerificationThe check that returns pass or failSection 02
MemoryA log of what happened each runSection 05

The loop runs execution, asks verification for a verdict, and on a fail reruns with the failure reasons in hand, until it passes.

One rule makes the verdict trustworthy: run verification in a separate agent that shares no context with the one that did the work. An agent reviewing its own output approves it easier, the way a person reviewing their own work does. Guardrails for hours-long agent runs builds its verifiers on the same principle.

04Run it in training mode first

A new loop gets a training mode: for the first few runs, it pauses at every step and asks approval before continuing. Once the runs match what you want, turn the pauses off.

The caution is about money as much as safety. A loop with a bad verification step reruns forever, and every rerun spends tokens. Stop hitting your token limit covers what that burn looks like from the billing side.

05Keep humans at the checkpoints

Push-a-button, walk-away automation fails wherever the cost of an error is high. What works: you frame the problem at the start, the agent runs the middle, and you review at the end before anything goes public.

Ask of any workflow you automate: at which checkpoint would a wrong call ruin everything downstream? Those checkpoints get a human. Build the automation around them, never through them, and let the loop own the stretch in between.

The last block is the run log. Every loop run appends an entry: what it did, what got fixed, what problem came back. Once a week, ask the agent one question across that history: which problems keep showing up that are worth solving? The answers become new gotchas, new scripts, or a better verification step, the same drift-catching habit Keep a growing knowledge base accurate applies to files.

Further reading

FAQ

A skill fetches the same data every run and does it a little differently each time. What is the restructure?

Split the skill's work into judgment and repetition. The fetch is repetitive, so have the model write a script for it once and make the skill call that script; a script runs the same way every time and spends no tokens figuring out how. The model keeps only the part that needs judgment, like classifying what the script fetched.

Why does the verification step belong to a different agent than the one that did the work?

An agent grading its own output approves it too easily, the same way a person reviewing their own work does. A separate agent with none of the working context judges only what is in front of it, so a pass from it means more. The loop needs that honesty, because a soft verdict just reruns the same mistake.

Where does a human belong in an automated workflow?

At the checkpoints where the cost of an error is high: the start, where the problem gets framed, and any point where a wrong call ruins everything downstream, especially the last review before output goes public. Build the automation around those checkpoints and let the loop run everything between them.

Sources
  1. Austin Marchese · “17 Tricks To Build 10x Faster with Claude”
    cited at 7:09 · 11:06 · 12:46 · 14:09 · 14:48 · 15:47 · 16:04 · 16:46 · 17:27 · 17:48