# Four kinds of agent loop, sorted by what starts and stops them

> The Claude Code team sorts agent loops into four kinds by two questions: what starts a run and what tells it to stop. Picking the kind first saves you from building machinery the work never needed.

## The four kinds

| Kind       | Starts on                                    | Stops when                                                       | Analyst example                                   |
| ---------- | -------------------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------- |
| Turn-based | each prompt you send                         | it answers, and you decide the next turn                         | asking why yesterday's revenue dipped             |
| Goal-based | one request                                  | an evaluator confirms the success criteria, or a turn cap is hit | reconcile every account in a region to the ledger |
| Time-based | a fixed interval, such as `/loop`            | you stop it or it expires                                        | check the pipeline every hour for a failed load   |
| Proactive  | an event or a schedule, with nobody watching | the task's own goal is met                                       | triage each new data-quality ticket as it lands   |

A turn-based loop is the ordinary agent session: you direct every turn. A goal-based loop hands the stopping decision to an evaluator model that checks the [Success criteria](/garden/success-criteria) each time the agent tries to finish. Time-based and proactive loops remove the human from triggering the run as well.

## They compose

A time-based loop makes a good trigger for a goal. The schedule notices the problem, and the goal fixes it. That is the pairing [Loop engineering](/garden/loop-engineering) builds on. Proactive loops can send routine runs to a smaller, faster model and save the most capable one for judgement calls, the same dial as [Set the LLM model per agent, not one for the whole system](/garden/model-per-agent).

## Start with the simplest kind that works

That is the team's own advice. Most recurring analyst work starts as a time-based check, and it earns a goal only once "fixed" can be written as a condition an evaluator can test.

## The bottom line

Name the trigger and the stop before building anything. The answers pick the kind of loop for you.

*Source: Addy Osmani, "[Practical Loop Engineering](https://addyosmani.com/blog/practical-loop-engineering/)" (2026), summarising the Claude Code team's loop types.*
