Deep Dive · XiaoHu Explainer

Claude Code's Official Take on Loop Design: 4 Levels from Manual Approval to Unattended

From manual confirmation to fully unattended — the Claude Code team lays out a 4-tier loop taxonomy with practical guidance
60-Second Summary
  • The Anthropic Claude Code team published a blog post breaking down "designing loops" into 4 standard patterns: turn-based, goal-based (/goal), time-based (/loop and /schedule), and proactive — progressing from low to high autonomy.
  • The official definition of a loop: an agent repeatedly executes rounds of work until some stop condition is met. The four types are distinguished along four dimensions: who triggers it, how it decides to stop, which feature implements it, and what tasks it fits.
  • The core mechanism of /goal is bringing in a separate evaluator model to judge whether the bar has been met — Claude itself is not allowed to decide "good enough, I'm done" on its own, and you can also cap the maximum number of attempts.
  • Proactive loops stack five features together — /schedule (timed trigger), /goal (stop condition), skills (verification standard), dynamic workflows (multi-agent parallel orchestration), and auto mode (no manual approval needed) — to handle ongoing work like bug-report triage, issue classification, and dependency upgrades without anyone watching.
  • Two practical tips: use scripts for deterministic work — it's cheaper in tokens than having Claude re-derive the same steps every time; and for large-scale dynamic workflows (which can spin up hundreds of agents), do a small-scale test run before going wide.
Stance note: This piece is from Anthropic's official blog, covering Claude Code's own capabilities and feature combinations — it's vendor-published content. The classification framework, sample code, and figures like the 90-point score and "hundreds of agents" are all taken directly from the source and reflect the official framing.
1Background · What This Is About

AI Does the Work — But Who Decides It's "Done"?

Delba de Oliveira and Michael Segner of the Claude Code team published a post on Anthropic's official blog on June 30, 2026, systematically laying out how to design "loops" for Claude Code — having the agent repeat work until a stop condition is met.

The authors open with an observation: on X, everyone's talking about "stop prompting coding agents one line at a time — design a loop instead," but if you actually go look for what a "loop" even is, you get a pile of conflicting answers. This piece sets out to clear that up.

It's not a new product launch — it's a framework: it takes 5 features Claude Code already had and organizes them into 4 tiers of loops ranked by autonomy, with ready-to-copy combination templates.
Why it's worth reading: this is the first time /goal, /loop, /schedule, dynamic workflows, and auto mode have been placed on a single coordinate system, arranged into 4 tiers from "you watch every round" to "fully unattended." At the end there's also a copy-paste pipeline showing how to combine these features into a system that automatically handles bug triage, issue classification, and dependency upgrades.

Below, we break down the 4 tiers of loops from simplest to most complex — each one should map onto some kind of work you already deal with.

2Definition and Coordinate System

First, What Exactly Is a "Loop"

The official definition is one sentence: a loop is an agent repeatedly executing rounds of work until some stop condition is met. The key distinction is that "when it's considered done" is decided in advance and handed off to the system to judge — it's not you nudging it round after round yourself.

The authors classify loops along four dimensions, and these four dimensions form the shared reference frame for everything that follows: who triggers it, how it decides it should stop, which Claude Code feature it's implemented with, and what tasks it's best suited for. Set up the coordinate system first, then slot each of the four loop types into it.

Autonomy ↑ ① Turn-based ② Goal-based ③ Time-based ④ Proactive Inner ring: you watch every round Outer ring: fully unattended
The further out the ring, the higher the autonomy and the less oversight needed; the outermost, continuously flowing track is a loop actually running unattended right now
① Who triggers it

A single prompt → manual, real-time → on a schedule (fixed interval) → event or schedule, with no one present at all

② How it decides to stop

Claude decides on its own → meets the bar or hits the retry cap → you cancel it or the work runs out → each task exits when it meets its bar, and you shut down the whole pipeline manually

③ What feature it uses

Default conversation → /goal/loop, /schedule → all of the above + dynamic workflows + auto mode

④ What tasks it fits

Short tasks → tasks with verifiable exit criteria → recurring tasks or ones tied to external systems → recurring workflows with a clear definition

The authors also note: not every task needs a complex loop — start with the simplest approach, and pick these patterns up only as needed.

3Tier 1 · Turn-Based

You Ask, It Does One Round

This is the default mode you use every day. Every prompt you send kicks off a loop where you personally guide each round: Claude gathers context, makes the change, checks its own work, repeats if needed, and reports back. The official term for this is the "agentic loop."

An example from the source: you ask Claude to build a like button. It reads your code, edits the files, runs the tests, and hands back something it believes works. From there, you manually review it and write the next prompt. The trigger is a single prompt, the decision to stop rests with Claude itself, and it's suited to short tasks that aren't part of a fixed process or schedule.

Read context
Make the change
Run tests, self-check
Hand back for your review
Turn-based loop diagram
Figure from the source: a turn-based loop (agentic loop) diagram — a single prompt triggers it, Claude self-checks, then hands back for your manual review. Source: Claude's official blog

Making Its Self-Checks More Thorough

You can strengthen the "verification" step by writing your usual manual review steps into a SKILL.md, so Claude can check more end-to-end on its own. The key is giving it tools or connectors it can see, measure, and act on — the more quantifiable the checks, the easier it is for Claude to self-verify, and the fewer rounds it needs.

The source gives a verify-frontend-change skill example: for any frontend change, it's not allowed to declare victory just because the edit succeeded — it has to go through the same process a human reviewer would.

  1. Start the dev server and open the changed page in the browser
  2. Interact with the change directly: click the button, confirm the state change, take before/after screenshots
  3. Check the browser console: no new errors or warnings allowed
  4. Run a performance trace with Chrome DevTools MCP and audit Core Web Vitals

If any step fails, fix it and rerun from step 1 — never hand back partially finished work.

View the original SKILL.md sample code
---
name: verify-frontend-change
description: Verify any UI change end-to-end before declaring it done.
---

# Verifying frontend changes
Never report a UI change as complete based on a successful edit alone.
Verify it the way a human reviewer would:

1. Start the dev server and open the edited page in the browser.
2. Interact with the change directly. For a new control (button,
   input, toggle): click it, confirm the expected state change,
   and screenshot before/after.
3. Check the browser console: zero new errors or warnings.
4. Use the Chrome Devtools MCP, run a performance trace and audit
   Core Web Vitals.

If any step fails, fix the issue and rerun from step 1 — do
not hand back partially verified work.
4Tier 2 · Goal-Based · Core

Set the "Passing Bar" First, Then It's Allowed to Stop

Sometimes one round isn't enough, especially for complex tasks. Agents perform better when they can iterate repeatedly. You can use /goal to clearly define "what counts as done" and extend the time Claude spends iterating.

Core mechanism

Once you've defined success criteria, Claude no longer has to judge for itself whether something is "good enough" and quit early. Every time Claude wants to stop, a separate evaluator model checks its work against your criteria — if it doesn't meet the bar, it gets sent back to keep working, and this continues until the goal is met or the retry cap you set is reached.

In other words, the decision-making power is taken out of Claude's hands and given to an evaluator model dedicated to checking against the standard. This is also why "deterministic criteria" work especially well — things like a number of passing tests, or clearing a score threshold — an evaluator model can check these off cleanly, with no ambiguity.

Claude iterates Tries to stop Evaluator model Scores against your criteria Passed? Passed / retry cap hit → stop Passed / cap hit Not yet · sent back to redo
Every time Claude wants to stop, it has to clear the evaluator model's gate: if it falls short it's sent back along the dashed path to redo the work; only passing or hitting the cap actually stops it
An analogy

Like a QC checkpoint before submitting work: the inspector doesn't grade their own work — a different person (the evaluator model) checks it item by item against a standards sheet, sends it back if it falls short, up to a capped number of retries.

Goal-based loop diagram
Figure from the source: a goal-based loop (/goal) diagram — the evaluator model checks against the exit criteria. Source: Claude's official blog

A concrete example:

/goal get the homepage Lighthouse score to 90 or above, stop after 5 tries.
90 points
The example's Lighthouse target, checked by the evaluator model
5 tries
Max retries if the bar isn't met — stops at the cap to keep costs in check

Goal-based loops fit tasks with verifiable exit criteria; what you hand off is a "stop condition," implemented via /goal. To manage cost: make both the completion criteria and the retry cap concrete — e.g., "stop after 5 tries."

5Tier 3 · Time-Based

Check In on a Schedule

Some work is recurring: the task stays the same, only the input changes — like summarizing Slack messages every morning. Other work depends on an external system, and the simplest way to hook into it is to check at a fixed interval and react to whatever changed — a PR, for instance, might get review comments or its CI might break.

This kind of work is triggered with /loop, which reruns a prompt at a fixed interval. The stop condition is either you canceling it, or the work being done (the PR merged, the queue empty). Example:

/loop 5m check my PR, address review comments, and fix failing CI
/loop Runs locally

Reruns the same prompt at a fixed interval on your own machine.

Turn off your computer, it stops. Good for work you're present for and watching temporarily.

/schedule Moves to the cloud

Use /schedule to create a routine that moves this "rerun on a timer" setup to run persistently in the cloud.

Turn off your computer, it keeps running. Good for work that needs to stay running long-term, independent of whether you're around.

5 minutes
Example: /loop 5m checks the PR every 5 minutes, addresses review comments, fixes failing CI
Stretch as needed
To manage cost: lengthen the interval, or switch to "react to events" instead of watching the clock
6Tier 4 · Proactive · Core

Stack Five Features Together and It Runs Itself, Unattended

On top of the primitives above, adding auto mode (no need to stop and ask you at every step) and dynamic workflows (research preview) lets you combine them into a loop that handles long-running work. It's triggered by an event or schedule, with no one present in real time at all.

The stop logic of a proactive loop has two layers: each individual task exits once it hits its own goal, while the routine itself keeps running until you manually shut it down. It's best suited to recurring, clearly defined workflows: bug reports, issue triage, migrations, dependency upgrades, and so on.

Combination playbook

Take handling feedback as an example — the official approach is to stack four features layer by layer, then wrap the whole thing in auto mode:

/schedule Timed trigger
Create a routine that checks for new reports every hour (research preview)
/goal Stop condition
Define what counts as "done," paired with skills describing how to verify it
skills Verification standard
Codify "what counts as fixed" into a skill so Claude can self-check
dynamic workflows Multi-agent orchestration
Orchestrate a batch of agents to triage each report, fix it, and review the fix
auto mode No manual approval
Wraps the outermost layer so the whole routine runs to completion without pausing to ask for permission
Proactive loop diagram
Figure from the source: a proactive loop diagram — triggered by an event or schedule, with no one present in real time. Source: Claude's official blog

Put it all together, and a full prompt looks like this:

/schedule every hour: check #project-feedback for bug reports.
/goal: don't stop until every report found this run is triaged,
actioned, and responded to. When fixing a bug, use a workflow to
explore three solutions in parallel worktrees and have a judge
adversarially review them.

In plain terms: every hour, check the #project-feedback channel for bug reports; don't stop until every report found in this run is triaged, actioned, and responded to; when fixing a given bug, use a workflow that tries three solutions in parallel across three separate worktrees, then has a judge agent adversarially pick apart each one. Here, dynamic workflows can spin up on the order of hundreds of sub-agents in a single run, working in parallel and coordinating with each other.

Proactive closed loop Runs until you shut it down manually 1 2 3 4 5 Watch #project-feedback Triage reports Fix in 3 parallel worktrees Judge reviews adversarially Respond · wrap up
Event triggers → triage → multi-agent parallel exploration of three fixes → judge review → auto wrap-up, then back to watching for the next event

To manage cost: hand the routine off to smaller, faster models, and reserve the strongest model only for the key decision points that need it.

7Quality Assurance

Don't Let the Loop Drift Off Course

The quality of a loop's output depends on the system around it. When designing that system, the source gives four principles:

  • Keep the codebase itself clean

    Claude follows the patterns and conventions already in your codebase — the cleaner the foundation, the cleaner what it produces will be.

  • Give Claude a way to self-check

    Codify "what counts as good" into skills that reflect your and your team's standards, so it can check itself end-to-end.

  • Keep documentation within reach

    Framework and library docs carry the latest best practices — don't make it guess from stale memory.

  • Use a second agent for code review

    A reviewer with a completely fresh context has fewer biases and isn't influenced by the main agent's reasoning. You can use the built-in /code-review, or hook into GitHub's Code Review.

Mindset

When a given run falls short, don't just stop at fixing that one instance. Try to codify it into a rule that improves the whole system, so every future iteration benefits. When something goes wrong, what you should fix is the system's rules, not just that one result.

8Saving Tokens

Don't Let a Loop Quietly Burn Through Your Tokens

To keep tokens in check, a loop needs clear boundaries. The source gives an actionable checklist of six items:

1Pick the right primitive and model sizeSmall tasks don't need multiple agents or a loop — some tasks are fine with a cheaper, faster model.
2Define clear success and stop criteriaSpell out what counts as done so Claude gets there faster, without stopping too early.
3Test small before scaling upDynamic workflows can spin up hundreds of agents — estimate cost on a small slice of work first.
4Use scripts for deterministic workRunning a script is cheaper than re-deriving it every time — e.g., the PDF skill ships with its own form-filling script that Claude just runs directly, instead of rewriting the code.
5Don't run more often than neededSet the polling interval based on how often the monitored thing actually changes, not a fixed default.
6Review spend regularly/usage breaks down recent usage by skills, subagents, and MCP; /goal with no arguments shows rounds and tokens used so far; /workflows shows per-agent usage and lets you stop any of them at any time.
Hundreds
The order of magnitude of agents a single dynamic workflows run can spin up — always test small before going wide
Script < re-derive
Running a script for deterministic steps is cheaper than having Claude re-derive the code every time
9Quick Reference

Which Loop to Pick — One Table Explains It

Facing a specific task, you need to be clear on three things: what you're handing off, when to use it, and which feature to use. This summary table from the source lines up the four tiers row by row for comparison — click each card to see a concrete example.

LoopYou hand offWhen to use itWhat you use
Turn-based"A check"You're exploring or making decisionsCustom verification skills
Goal-based"A stop condition"You know what counts as done/goal
Time-based"A trigger"Work happens outside the project, on a schedule/loop, /schedule
Proactive"A prompt"Work recurs and is clearly definedAll of the above + dynamic workflows
Turn-based · See example

Ask Claude to build a like button: it reads the code, edits the files, runs tests, and hands back a version it believes works; you review it manually before writing the next prompt.

Goal-based · See example
/goal get the homepage Lighthouse score to 90 or above, stop after 5 tries.
Time-based · See example
/loop 5m check my PR, address review comments, and fix failing CI
Proactive · See example
/schedule every hour: check #project-feedback for bug reports.
/goal: don't stop until every report found this run is triaged,
actioned, and responded to. When fixing a bug, use a workflow to
explore three solutions in parallel worktrees and have a judge
adversarially review them.
Where to Start · Three Self-Check Questions

Look at work you're already doing, pick a task where you're the bottleneck, and ask yourself what part can be handed off:

  1. Can you write a verification check for this?
  2. Is the goal here clear enough?
  3. Does this work run on a schedule?

Once you have an idea, get the loop running, watch where it gets stuck or goes off track, and then iterate on it freely.

We define a loop as: an agent repeatedly executing rounds of work until some stop condition is met. Claude Code team, Getting started with loops, 2026-06-30
Source: Claude's official blog, "Getting started with loops" (claude.com/blog/getting-started-with-loops), by Delba de Oliveira and Michael Segner, published 2026-06-30. This piece is a Chinese-language visual explainer of that vendor-published content; the classification framework, sample code (/goal, /loop, /schedule, and combined prompts), and figures such as "90 points, 5 tries, hundreds of agents" are all taken from the source and reflect the official framing. Dynamic workflows and /schedule are noted in the source as research preview features.