Claude Code
A cap on how many tool-use round trips an agent loop may run before it is forced to stop.
A cap on how many tool-use round trips an agent loop may run before it is forced to stop. In the Claude Agent SDK, a turn is one cycle: the model asks for tool calls, the SDK runs them, and the results go back to the model. When maxTurns is reached, the run ends with an error_max_turns result. Claude Code offers the same limit as --max-turns in print mode, unlimited by default, and it pairs well with a spend cap like --max-budget-usd.
Primary source: code.claude.com
Example
Claude Code offers the same limit as --max-turns in print mode, unlimited by default, and it pairs well with a spend cap like --max-budget-usd.
Hands-on guides, comparisons, and tutorials that cover Claude Code.
FAQ
A cap on how many tool-use round trips an agent loop may run before it is forced to stop.
Max Turns sits in the Claude Code part of the AI stack. Understanding it helps you make better decisions when building, debugging, and shipping AI features.
Developers Digest publishes tutorials and videos that cover Claude Code topics including Max Turns. Check the blog and YouTube channel for hands-on walkthroughs.
Related
Billing model usage against a pool of consumable credits so that programmatic and interactive work draw from separate budgets.
The phase in an agent's workflow where it analyzes a task, breaks it into steps, and determines the order of operations before taking any action.
Combining the weights of two or more models into a single model without further training, usually by averaging or interpolating their parameters.

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.