{"version":"2.1.285","anchor":"sdk-maxturns-normalization-and-error-state-tracking","canonical_anchor":"sdk-maxturns-normalization-and-error-state-tracking","heading":"SDK tidies its maxTurns value and tracks errors in turns without a model","tier":"internal","area":"SDK","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285\/e\/sdk-maxturns-normalization-and-error-state-tracking","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285","markdown":"### SDK tidies its maxTurns value and tracks errors in turns without a model\n\nIn the SDK, the `maxTurns` value is now normalized before use, and errors from turns that end without the model are tracked\n\n**Unclear.** It is not clear how `maxTurns` values are changed by normalizing, or how the tracked errors show up in SDK output.\n\n**What**\n\nThe SDK is the library for running Claude Code from your own programs. The `maxTurns` option caps how many turns a run may take, and Claude Code now normalizes this value into a standard form before using it.\n\nThe SDK's output stream also now keeps track of two things:\n\n- whether a turn ended without the model being called\n\n- any error text that came before such turns\n\n**Why**\n\nThis affects how errors are reported to programs that use the SDK.\n\n- Area: SDK\n- Names: `maxTurns`\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}