Getting Started with Loops
- Source
- x.com
- Author
- ClaudeDevs
- Date

Context
A coding can keep working after its first answer if completion has a checkable definition. Anthropic's guide to loops describes goal-based work as repeated attempts governed by an explicit finish condition, such as a number of passing tests, together with a cap on how many turns to keep trying.
With Claude Code's /goal command, each time Claude tries to stop, a separate evaluator model checks the condition and sends it back to work until the goal is met or the turn limit is reached. The guide argues that deterministic criteria, such as tests passed or a score threshold, work well because Claude no longer has to judge what is good enough. A useful goal therefore defines both the desired outcome and how to tell it has been reached.
- The goal loop is enforced by a second model. Each time Claude tries to stop, an evaluator checks your stated condition and sends it back to work, which is why deterministic criteria (tests passing, a score threshold) work far better than 'make it good'.
- The way to shorten a turn-based loop is to move your own verification steps into a , with tools that let Claude see and measure the result. The more quantitative the check, the more of its work Claude can confirm itself.
- /loop runs on your machine and dies when the machine does; /schedule moves the same recurring prompt into a cloud routine that keeps running without you.
- For always-on routines, route the routine work to smaller, faster models and spend the most capable model only on judgment calls.
- Loop output quality is mostly a property of the codebase, not the prompt: Claude copies the conventions already present, so a messy repo produces messy autonomous work.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- agent skill — A reusable instruction file that teaches an agent how to do one job well — the procedure, the tools, and what counts as done.
“we define loops as agents repeating cycles of work until a stop condition is met”
“When you define the success criteria, Claude doesn’t have to make a determination on what is “good enough” and end the loop early.”
“Not all tasks require complex loops; start with the simplest solution and use these patterns selectively.”
“The quality of a loop’s output depends on the system around it.”
Checking sign-in…
Loading comments…






