# G10 — How the agent loop works

- Publisher: Anthropic / Claude Code Docs
- Primary source: [How the agent loop works](https://code.claude.com/docs/en/agent-sdk/agent-loop)
- Observed: 2026-10-22 (Europe/Berlin session date)
- Publication date: unknown — no reliable date established from the read
- Updated date: unknown — no reliable date established from the read
- Read status: opened and relevant section read through web tool
- Evidence locator: Control how the loop runs — Turns and budget; Budget headroom
- Evidence class: primary maintainer/provider guidance; not an independent impact study

## Short evidence fragment

> Spend can therefore pass the cap by up to the cost of that one response

## Researcher's reading note

The SDK exposes max turns and estimated-spend caps. The documentation describes subagent inclusion and post-response checks, so a cap can overshoot.

## Limits and use

Version-dependent behavior: documented cap enforcement requires Claude Code v2.1.217 or later. This is one SDK example; external tools and infrastructure need separate control.

## Retention

This card preserves a short evidence fragment and an original reading note; full source text is not copied. FinOps/FOCUS adaptations should credit the FinOps Foundation / FOCUS as applicable (their pages state CC BY 4.0). Re-open mutable documentation before implementing controls.
