Claude Code team's taxonomy of agent loops and how to bound them
- Source
- x.com
- Publisher
- Anthropic
- Date
https://t.co/v694m8Eaj6
Context
The Claude Code team at Anthropic uses "loop" to mean an agent repeating cycles of work until a is met. In a long post from the ClaudeDevs account, the team sorts loops by what starts them and what ends them, and its advice for keeping them bounded starts with two things: give the agent a way to check that the work is done, and set a limit for when it is not.
The simplest case is an ordinary prompt. Claude gathers , makes a change, checks its work and replies, and the person checks the result and writes the next prompt. The team calls this the , and says it gets better when the manual checking steps are written into a skill file (a SKILL.md) with tools that let Claude see or measure the result. The goal-based loop, started with the `/goal` command, takes the stopping decision away from Claude's own sense of what is good enough: each time Claude tries to stop, an evaluator model checks the condition the user wrote and sends it back to work until the goal is met or a turn limit is reached. The post says this is why deterministic criteria such as a number of passing tests or a score threshold work so well, and it recommends an explicit cap such as "stop after 5 tries."
The other two types are started by something other than a live prompt. A time-based loop (`/loop`) re-runs a prompt on an interval, for jobs like a morning summary of Slack messages or watching a pull request for reviews and failing CI, and it ends when the user cancels it or the work completes. Because `/loop` runs on the user's own computer, the post says `/schedule` moves the same idea to a routine in the cloud. A proactive loop combines these pieces, so a scheduled routine picks up incoming work such as bug reports, `/goal` defines when each item is finished, and auto mode lets it run without stopping to ask permission. Here each task ends at its goal, but the routine runs until someone turns it off.
Most of the cost advice follows from the same idea of clear boundaries. The post recommends choosing the smallest primitive and a cheaper model where that is enough, piloting on a small slice before a run that could spawn hundreds of agents, using scripts for deterministic steps instead of having the model reason through them each time, and matching a routine's interval to how often the watched thing changes. It also points to `/usage`, `/goal` with no arguments, and `/workflows` for seeing where tokens went. The team's own caveat is that not every task needs a complex loop, so start with the simplest option that works.
- Stop condition — A situation, named in advance, in which the agent should stop and hand the decision back to a person rather than choose a way around it.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
- agentic loop — The cycle an agent runs in: decide, call a tool, read the result, decide again — repeating until the goal is met or a stop condition fires.
- model routing — Sending each request to a model chosen by the difficulty of the task, rather than using one model for everything.





