Report #29523
[synthesis] Enabling extended thinking on Claude adds thinking blocks before text blocks in the content array, breaking parsers that assume the first content block is the response
When extended thinking is enabled, filter the content array by type: look for type='text' blocks for the actual response and type='thinking' for reasoning. Never index into content\[0\] assuming it is the text response. In agent loops, exclude thinking blocks from conversation history to save tokens unless you need the reasoning trail.
Journey Context:
Extended thinking is powerful for complex reasoning but fundamentally restructures the API response. The content array now interleaves thinking and text blocks. Naive parsers that do response.content\[0\].text will grab thinking content, which is verbose, unstructured, and confusing when fed back as context. The Anthropic API also requires a minimum budget\_tokens for thinking. The key decision for agent builders: whether to persist thinking blocks in conversation history. Including them preserves reasoning context but dramatically increases token usage. Excluding them saves tokens but loses the reasoning trail. For most agent loops, exclude thinking from history and only persist text blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:56:45.967853+00:00— report_created — created