Claude Code's Official Breakdown of Loop Design: 4 Escalating Levels to Unattended Autonomy

From manual confirmation to fully unattended — the Claude Code team lays out a 4-level loop taxonomy with practical advice
By Claude Blog07-02 · 8 min read⚑ Company PR · read with that in mind
🎧 Listen to the podcast0:00 / --:--
0:00 / --:--
Deep Dive · XiaoHu Explains
60-Second Overview
  • Anthropic's Claude Code team published a blog post breaking "designing a loop" into 4 standard patterns: turn-based, goal-based (/goal), time-based (/loop and /schedule), and proactive — escalating from low to high autonomy.
  • The official definition of a loop: an agent repeatedly executes rounds of work until some stopping 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 kind of task it suits.
  • The core mechanism of /goal is bringing in a separate evaluator model to judge whether the bar has been cleared — Claude itself can't just decide "good enough" and call it done — and you can also cap the maximum number of attempts.
  • Proactive loops stack five features together — /schedule (time-based triggering), /goal (stopping condition), skills (validation criteria), dynamic workflows (multi-agent parallel orchestration), and auto mode (no manual confirmation) — to handle ongoing work like bug-report triage, issue classification, and dependency upgrades, unattended.
  • Two practical recommendations: use scripts for deterministic work — it's cheaper in tokens than making Claude re-derive it every time; and for large-scale dynamic workflows (which can spin up hundreds of agents), do a small-scale test run before going live.
⚑
Stance note: this piece is from Anthropic's official blog and covers Claude Code's own capabilities and feature combinations — it's vendor-published content. The classification framework, sample code, and figures like 90 and "hundreds of agents" cited in this piece are all drawn from the original — this is the official line.
1Background · What This Piece Covers

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

Claude Code team members Delba de Oliveira and Michael Segner published a post on Anthropic's official blog on June 30, 2026, laying out a systematic approach to designing "loops" for Claude Code: having an agent repeatedly execute work until it meets a stopping condition.

The authors open by pointing to a phenomenon: X is full of chatter about "stop prompting your coding agent one line at a time — design loops instead," but if you actually go look for what a loop even is, you'll find a pile of answers that contradict each other. This piece sets out to clear that up.

It isn't a new product launch — it's a framework: taking 5 standalone features that already existed in Claude Code and organizing them into 4 loop types ranked by degree of autonomy, complete with combination templates you can copy directly.
⚡
Why it's worth reading: /goal, /loop, /schedule, dynamic workflows, and auto mode — these 5 features are placed on a single coordinate system for the first time, laid out in 4 levels from "you watch every round" to "fully unattended." At the end, the piece also gives a copyable pipeline that combines these features into a system that automatically handles bug triage, issue classification, and dependency upgrades.

Below, we unpack the 4 levels of loops one by one, from simplest to most complex — each one should map onto some class of work you already deal with.

2Definition and Coordinate System

First, Get Clear: What Exactly Is a "Loop"

The official definition is a single sentence: a loop is an agent repeatedly executing rounds of work until some stopping condition is met. The key distinction is that "when it's considered done" is defined in advance and left to the system to judge — not something you personally chase round after round.

The authors classify loops along four dimensions, and these four dimensions form the shared reference frame for every loop type that follows: who triggers it, how it decides it should stop, which feature in Claude Code implements it, and what kind of task it suits best. Set up the coordinate system first, and then the four loop types slot right in.

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 ring — the one with the continuously flowing track — is a loop actually running unattended right now
① Who triggers it

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

② How it decides to stop

Claude decides for itself → hits the bar or the retry cap → you cancel it or the work is done → each task exits on its own bar, you shut down the whole pipeline by hand

③ Which feature implements it

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

④ What it suits

Short tasks → tasks with a verifiable exit criterion → periodic tasks or ones that touch external systems → recurring, clearly-defined workflows

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

3Level 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 steer each round: Claude gathers context, makes the change, checks its own work, repeats if needed, and then reports back. Officially, this is called the "agentic loop."

An example from the original piece: you ask Claude to build a like button. It reads your code, edits the files, runs the tests, then hands back something it "believes" works. From there, you manually verify it and write the next prompt. What triggers it is a single prompt; the call on when to stop sits with Claude itself; it suits short tasks that don't belong to a fixed process and don't run on a schedule.

Read context
→
Make the change
→
Run tests, self-check
↺
Hand back for your review
Turn-based loop diagram
Original figure: a turn-based loop — triggered by a single prompt, Claude self-checks and hands it back for your manual confirmation. Source: Claude's official blog

How to Make Its Self-Checks More Thorough

You can strengthen the "verification" step: turn the steps you normally check by hand into a SKILL.md, so Claude can check more things end-to-end on its own. The key is giving it tools or connectors that let it see, measure, and act — the more quantifiable the check, the easier it is for Claude to self-verify, and the fewer rounds it needs.

The original piece gives a verify-frontend-change skill: for any frontend change, it's not allowed to declare the job done just because the edit succeeded — it has to walk through the whole process the way a human reviewer would.

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

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

See 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.
4Level 2 · Goal-Based · Core

Set the "Passing Bar" First — Only Then Can It Stop

Sometimes one round isn't enough, especially for complex tasks — agents perform better when they're allowed to iterate. You can use /goal to clearly define "what counts as done," extending how long Claude gets to iterate.

Core mechanism

Once you've defined a success criterion, Claude no longer has to judge for itself whether something is "good enough" and quit early. Every time Claude tries to stop, a separate evaluator model checks it against your criteria — if it doesn't pass, it gets sent back to keep working, until the goal is met or it hits the maximum number of attempts you set.

In other words, the power to decide gets taken out of Claude's hands and handed to a dedicated evaluator model. This is also why "deterministic criteria" work especially well — things like the number of passing tests or clearing a specific score threshold — the evaluator model can check them off unambiguously, with no ambiguity.

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

It's like a QC checkpoint before you turn in your homework: the inspector isn't grading their own work — it's a different party (the evaluator model) holding a checklist, checking off each item, sending it back for redo if it falls short, up to a maximum number of retries.

Goal-based loop diagram
Original figure: a goal-based loop (/goal) — an evaluator model checks 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
The Lighthouse pass bar set in the example, checked by the evaluator model
5 tries
Max retries if it doesn't hit the bar — stops at the cap, keeping cost in check

Goal-based loops suit tasks with a verifiable exit criterion; what you hand over is a "stopping condition," and the feature that implements it is /goal. To manage cost: make both the success criterion and the retry cap specific — e.g., "stop after 5 tries."

5Level 3 · Time-Based

Check In On a Schedule

Some work is periodic: the task itself stays the same and only the input changes — like rounding up Slack messages every morning. Other work depends on an external system, and the simplest way to hook into it is to check in at a fixed interval and react to whatever changed — like a PR that might get review comments or might have CI fail.

This class of work is triggered with /loop, which reruns a prompt at a set interval. It stops when you cancel it, or when the work is done (the PR gets merged, the queue empties). 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 your computer off, and it stops. Suits work you're around for and only need to watch for a while.

/schedule Moves to the cloud

Use /schedule to set up a routine, moving this "rerun on a timer" setup to run persistently in the cloud.

Turn your computer off, and it keeps running. Suits work that needs to stay up 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
Lengthen as needed
Managing cost: set a longer interval, or switch to "react to events" instead of watching the clock
6Level 4 · Proactive · Core

Stack Five Features and It Runs Itself, Unmanaged

Take the earlier primitives, add auto mode (auto mode — doesn't stop at every step to ask whether to continue) and dynamic workflows (dynamic orchestration across agents, research preview), and you get a loop that can be combined to handle long-running work. What triggers it is an event or a schedule, with no one present in real time at all.

A proactive loop's stopping logic 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 best suits recurring, clearly-defined workflows: bug reports, issue triage, migrations, dependency upgrades, and the like.

Combination play

Take handling feedback as an example — the official recipe stacks four features layer by layer, then wraps the whole thing in auto mode:

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

Put together, a complete 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; for every one found this run, don't stop until it's been triaged, actioned, and responded to; when fixing a given bug, use a workflow that tries three solutions in parallel across three separate branches (worktrees), then has a judge agent adversarially pick them apart. 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 1 2 3 4 5 Watch #project-feedback Triage reports Fix in 3 parallel worktrees Judge adversarial review Respond · wrap up
Event triggers → triage → multiple agents explore three solutions in parallel → judge reviews → auto wrap-up, then back to watching for the next event

To manage cost: hand the routine off to a smaller, faster model, and only bring in the strongest model at the key decision points that actually 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 official post gives four rules:

  • Keep the codebase itself clean

    Claude follows the patterns and conventions already in your codebase — if the foundation is clean, what it produces following that foundation will be clean too.

  • Give Claude a way to self-check

    Codify "what counts as good" into skills as a shared standard for you and your team, so it can check its own work end-to-end.

  • Keep documentation within reach

    A framework or library's official docs carry the latest best practices — don't make it guess from stale memory.

  • Use a second agent for code review

    A reviewer starting from a 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 up GitHub's Code Review.

Mindset

When a given result falls short, don't just stop at patching that one instance. Try to codify it as a rule and improve the system as a whole, so every later round of iteration benefits. When something goes wrong, what needs fixing 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 under control, a loop needs clear boundaries. The original piece gives a six-item, actionable checklist:

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.
2Set clear success and stopping criteriaSpell out what counts as done so Claude converges faster — but don't let it stop too early.
3Test small before running at scaledynamic workflows can spin up hundreds of agents — estimate the 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., a PDF-filling skill ships its own fill-in script that Claude just runs directly, instead of rewriting the code.
5Don't run more often than neededSet the polling interval to match how often the thing you're watching actually changes — don't hardcode it.
6Review spend regularly/usage breaks down recent usage by skills, subagents, and MCP; /goal with no arguments shows rounds used and tokens; /workflows shows per-agent usage and lets you stop any of them anytime.
Hundreds
The scale of agents dynamic workflows can spin up in a single run — always test small before scaling up
Script < re-derive
Running a script for deterministic steps is cheaper than making Claude re-derive the code every time
9Quick Reference

Which Loop to Pick — One Table Says It All

Facing a concrete task, you need to think through three things: what you hand over, when to use it, and which feature to use. The original piece's summary table lines up the four loop levels row by row for comparison — click into each card for a concrete example.

LoopYou hand overWhen to use itWhat you use
Turn-baseda "check"You're exploring or decidingCustom verification skills
Goal-baseda "stopping condition"You know what counts as done/goal
Time-baseda "trigger"Work happens outside the project on a schedule/loop, /schedule
Proactivea "prompt"Work is recurring and clearly definedAll of the above + dynamic workflows
Turn-based · see example

Ask Claude to build a like button: it reads the code, edits files, runs tests, and hands back a version it believes works; you manually verify it, then write 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 the work you're already doing, pick a task where you're the bottleneck, and ask yourself which piece can be handed off:

  1. Can you write down the verification checks for this task?
  2. Is the goal for this task 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 oversteps, and iterate on it from there.

We define a loop as: an agent repeatedly executing rounds of work until some stopping 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 visualized Chinese-language explainer of that vendor-published content; the classification framework, sample code (/goal, /loop, /schedule, and the combined prompts), and figures such as "90, 5 tries, hundreds of agents" cited here are all drawn from the original — this is the official line. dynamic workflows and /schedule are marked as research preview features in the original.
Source
Claude BlogClaude Blog·Read the source
↑ End of article
✓ This article is free to read in full

Members can copy or download the full Markdown, and let their AI subscribe and ask.

Read the original ↗
📮 New explainers, straight to your inbox

Found this useful? Leave your email — every new explainer, the moment it's out. Unsubscribe anytime.