thinking changedbuild-with-claude/thinking
Nearest release: v2.1.309, published 3 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+11added
Lines−9removed
From line
243
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits31to this page, all time
The whole hunk
from line 243, old and new numbered
/
from line 243
243243 ```
244244
245245 ```php PHP
246 use Anthropic\Messages\Model;
246247 use Anthropic\Messages\TextBlock;
247248 use Anthropic\Messages\ThinkingBlock;
248249
from line 257
256257 'content' => 'What is the greatest common divisor of 1071 and 462?'
257258 ]
258259 ],
259 model: 'claude-opus-5-5',
260 model: Model::CLAUDE_OPUS_5_5,
260261 thinking: ['type' => 'adaptive', 'display' => 'summarized'],
261262 );
262263
from line 434
433434 'content' => 'Summarize this article in one sentence.'
434435 ]
435436 ],
436 model: 'claude-sonnet-5',
437 model: Model::CLAUDE_SONNET_5,
437438 thinking: ['type' => 'disabled'],
438439 );
439440 ```
from line 533
532533Thinking works with [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming). Thinking blocks stream as `thinking_delta` events inside `content_block_delta` events, followed by a single `signature_delta` event just before the block's `content_block_stop`. Text blocks stream afterward as usual.
533534
534535<Frame>
535 
536 
536537</Frame>
537538
538539The following examples stream a response with adaptive thinking, printing thinking and text deltas as they arrive:
from line 721
720721 }
721722 case CONTENT_BLOCK_DELTA -> {
722723 var deltaEvent = event.asContentBlockDelta();
723 deltaEvent.delta().thinking().ifPresent(td ->
724 IO.print(td.thinking())
724 deltaEvent.delta().thinking().ifPresent(thinkingDelta ->
725 IO.print(thinkingDelta.thinking())
725726 );
726 deltaEvent.delta().text().ifPresent(td ->
727 IO.print(td.text())
727 deltaEvent.delta().text().ifPresent(textDelta ->
728 IO.print(textDelta.text())
728729 );
729730 }
730731 }
from line 735
734735 ```
735736
736737 ```php PHP
738 use Anthropic\Messages\Model;
737739 use Anthropic\Messages\RawContentBlockDeltaEvent;
738740 use Anthropic\Messages\RawContentBlockStartEvent;
739741 use Anthropic\Messages\TextDelta;
from line 748
746748 messages: [
747749 ['role' => 'user', 'content' => 'What is the greatest common divisor of 1071 and 462?']
748750 ],
749 model: 'claude-opus-5-5',
751 model: Model::CLAUDE_OPUS_5_5,
750752 thinking: ['type' => 'adaptive', 'display' => 'summarized'],
751753 );
752754
from line 908
9069081. **Tool choice limitation (manual mode):** tool use with manual extended thinking (`thinking: {type: "enabled"}`) only supports `tool_choice: {"type": "auto"}` (the default) or `tool_choice: {"type": "none"}`. Using `tool_choice: {"type": "any"}` or `tool_choice: {"type": "tool", "name": "..."}` results in an error because these options force tool use, which is incompatible with manual extended thinking. Adaptive thinking, including on models where thinking is on by default, supports forced tool use, except on Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5.1, and Claude Mythos 5.1 (see [Response prefill and forced tool use](https://platform.claude.com/docs/en/build-with-claude/thinking#limits-and-feature-compatibility)). Where forced tool use is accepted, the response starts with the tool call and has no `thinking` block.
9079092. **Preserving thinking blocks:** when you return tool results, you must pass the thinking blocks from the assistant message back to the API, complete and unmodified. See [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks).
908910
909**A tool-use loop is one assistant turn.** From the model's perspective, an assistant turn doesn't complete until Claude finishes its full response, which might include multiple tool calls and results. This whole sequence is a single assistant turn:
911**A tool-use loop is one assistant turn.** From the model's perspective, an assistant turn ends only when Claude completes its full response, which might include multiple tool calls and results. This whole sequence is a single assistant turn:
910912
911913```text wrap
912914User: "What's the weather in Paris?"
No line in this hunk matches that.