On June 30, 2026 at 17:28 UTC, Anthropic published 'Getting started with loops' on its official blog, written by Delba de Oliveira and Michael Segner from the Claude Code team.
The article does something Anthropic had never done before: it formally divides 'agent loop' — a term used loosely for two years by vendors and open-source communities — into four official types, each with recommended usage.
The Four Loop Types
1. Turn-based loop
- Trigger: every user prompt
- Stop condition: Claude judges it is done / needs more context
- Best for: non-recurring, one-off short tasks
- Core mechanism: read code → edit code → run tests → self-check → repeat → return the 'I think it's done' result
- Optimization: encode human verification steps into
SKILL.mdso Claude self-checks end to end - Trigger: real-time user prompt
- Stop condition: goal achieved or max turns reached
- Best for: tasks with verifiable exit criteria
- Core mechanism: deterministic criteria like
/goal get the homepage Lighthouse score to 90 or above, stop after 5 tries, with an evaluator model checking whether Claude actually met the goal; if not, it's sent back to keep working - Key design: deterministic conditions (test pass counts, score thresholds) beat free-form judgment
- Trigger: fixed time interval
- Stop condition: user cancellation / task completion (PR merged, queue drained)
- Best for: periodic work (morning Slack digests) or interfacing with external systems
- Core mechanism:
/loop 5m check my PR, address review comments, and fix failing CI— local time-based loop/schedule— moves the loop to the cloud- Optimization: prefer event-driven over time-driven triggers (fire only on change)
- Trigger: events or schedules, no human present
- Stop condition: each task exits when its goal is met; the whole routine runs until the user turns it off
- Best for: long-running workflows (bug triage, dependency upgrades, issue triage)
- Core mechanism: combine
/schedule+/goal+ dynamic workflows + auto mode - Full 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. - Maintain code quality — encode 'what counts as good' in SKILL.md; use a second agent for code review (independent context, not polluted by the main agent's reasoning)
- Manage token usage — dynamic workflows may spawn hundreds of agents; pilot small before scaling, and use scripts instead of reasoning wherever possible
- Official blog: https://claude.com/blog/getting-started-with-loops
- Claude Code docs: https://code.claude.com/docs/en/goal, https://code.claude.com/docs/en/routines, https://code.claude.com/docs/en/workflows
- Goal: Lighthouse ≥ 90
- Turns: 5
- Judgment: an independent evaluator model
- Proactive loop security boundaries — unattended agents on user machines are vulnerable to prompt injection hijacking.
- The
/goalevaluator is itself a model — weak evaluators stop too early or iterate too long. - Dynamic workflows spawning hundreds of agents — token cost and context management are open problems; the recommended 'pilot first' has no standard playbook.
- Trust in the tool itself — readers may want to evaluate tool credibility before enabling unattended routines.
2. Goal-based loop (/goal)
3. Time-based loop (/loop + /schedule)
4. Proactive loop
The article adds two extensions:
Reference links:
Why This Matters
The real significance is not teaching the /goal command — it's that Anthropic has finally created an official taxonomy of the agent paradigm.
For the past 18 months, 'agent' has been used chaotically: ChatGPT with tool calling is an agent, AutoGPT running 5 steps is an agent, CrewAI orchestrating roles is an agent. This blog is effectively the first engineering classification map of the term, organized by 'trigger method × stop condition × user presence'.
1. Choosing a loop type = choosing how often the user intervenes
| Loop type | User intervention | Task length | Risk | |---|---|---|---| | Turn-based | Every turn | Short | Low | | Goal-based | Setup + termination | Medium | Medium (wrong evaluator drifts) | | Time-based | Configuration | Medium-long | Medium (polling wastes tokens) | | Proactive | Almost none | Long | High (unattended failures are costly) |
The higher the automation, the larger the 'invisible cost' when things go wrong — hence the article's 'Don't run routines more often than you need to.'
2. /goal's real innovation: explicitly separating goal from turns
Previously users mixed the two: 'fix this bug, try a few more times if it fails' (how many?). /goal makes both explicit:
This is essentially contract-based testing applied to agent design — the agent explores freely within the contract, and must stop outside it.
3. Proactive loop = a preview of 'agent as a service'
A routine that runs continuously, triggers on events, defines its own goals, and stops on completion is essentially the agent version of SaaS — a 24/7 service for a class of tasks. Claude Code's official endorsement pushes this from grassroots experiments to the mainstream.
4. SKILL.md gets a second spotlight
SKILL.md is Claude Code's skill-definition file: what counts as done, how to verify it, what tools to verify with. SKILL.md + goal + dynamic workflows form Anthropic's 'agent engineering trinity'. We used to write prompts; going forward we write SKILL + goal + routine — prompts degrade to high-level intent while execution details sink into engineered files.