{"name":"maxTurns","slug":"maxturns","family":"setting","title":"Settings keys","noun":"settings key","description":"The built-in autonomous agent can now keep working for 500 turns instead of stopping at 200.","description_source":"entry","described_by":{"version":"2.1.246","anchor":"built-in-autonomous-agent-can-run-500-turns"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.285","builds":0,"mined_builds":128,"first_cited":null},"aliases":[],"entries":[{"version":"2.1.285","anchor":"max-turns-passed-through-to-a-request","heading":"A turn limit is now passed along with a request when one is set","line":"When a `maxTurns` turn limit is set, Claude Code now sends it along with a request instead of leaving it out","released_at":"2026-09-29 17:32:09","reason":"named in this entry, found in this entry's text"},{"version":"2.1.285","anchor":"sdk-maxturns-normalization-and-error-state-tracking","heading":"SDK tidies its maxTurns value and tracks errors in turns without a model","line":"In the SDK, the `maxTurns` value is now normalized before use, and errors from turns that end without the model are tracked","released_at":"2026-09-29 17:32:09","reason":"named in this entry, found in this entry's text"},{"version":"2.1.285","anchor":"typed-tool-flags-snapshotted-maxturns-passthrough","heading":"Tool restrictions and turn limits now carry over to spawned sessions","line":"Spawned sessions now keep your `disallowedTools` and `tools` restrictions and your `maxTurns` limit","released_at":"2026-09-29 17:32:09","reason":"found in this entry's text"},{"version":"2.1.251","anchor":"web-fetching-capped-at-15-turns-and-runs-in-the-foreground","heading":"Web fetching capped at 15 turns and runs in the foreground","line":"Web fetching is capped at 15 turns and runs in the foreground unless you background it.","released_at":"2026-08-28 15:34:26","reason":"found in this entry's text"},{"version":"2.1.246","anchor":"built-in-autonomous-agent-can-run-500-turns","heading":"Built-in autonomous agent can run 500 turns","line":"The built-in autonomous agent can now keep working for 500 turns instead of stopping at 200.","released_at":"2026-08-25 19:17:34","reason":"found in this entry's text"},{"version":"2.1.30","anchor":"enhanced-custom-subagent-schema","heading":"Enhanced Custom Subagent Schema","line":null,"released_at":"2026-02-03 16:34:38","reason":"found in this entry's text"}],"entries_total":6,"docs":[{"source":"api","path":"agents-and-tools\/tool-use\/advisor-tool","title":"advisor-tool","documented":false},{"source":"claude-code","path":"agent-sdk\/agent-loop","title":"How the agent loop works","documented":false},{"source":"claude-code","path":"agent-sdk\/configuration","title":"Configure your agent","documented":false},{"source":"claude-code","path":"agent-sdk\/hosting","title":"Hosting the Agent SDK","documented":false},{"source":"claude-code","path":"agent-sdk\/plugins","title":"Plugins in the SDK","documented":false},{"source":"claude-code","path":"agent-sdk\/python","title":"Agent SDK reference - Python","documented":false},{"source":"claude-code","path":"agent-sdk\/sessions","title":"Work with sessions","documented":false},{"source":"claude-code","path":"agent-sdk\/skills","title":"Extend agents with skills","documented":false},{"source":"claude-code","path":"agent-sdk\/streaming-vs-single-mode","title":"Streaming Input","documented":false},{"source":"claude-code","path":"agent-sdk\/subagents","title":"Subagents in the SDK","documented":false}],"docs_total":12,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/setting\/maxturns","family_url":"https:\/\/changelogs.core-directive.com\/reference\/setting.json"}