Extended thinking with tool use ⚠ verify
Definition
When you return a tool_result while thinking is active, you must include the entire unmodified thinking block (including its cryptographic signature) that accompanied the tool request — the one case where you must pass thinking blocks back.
Key points
- The unmodified thinking block (incl.
signature) MUST accompany itstool_result; modifying or omitting it returns an error. - The API uses cryptographic signatures; tampering with a thinking block errors out.
tool_choice: anyandtool_choice: toolare NOT compatible with extended thinking — onlyauto(default) andnonework.- On Opus 4.5+ / Sonnet 4.6+ / Fable 5 / Mythos 5, the API keeps previous thinking blocks by default (they count as input tokens); on earlier Opus/Sonnet and all Haiku, previous thinking blocks are stripped automatically. ⚠ verify (2026-07-08).
- Thinking is billed as output tokens when generated; kept blocks are later billed as input.
Why it matters for the exam
- A recurring D1 question: returning a
tool_resultrequires echoing the full signed thinking block. Also tests theany/toolincompatibility with thinking.
Common gotchas
- Returning thinking blocks is required only in the tool-result case — not generally.
- Forcing a tool (
any/tool) with thinking on → error; useauto/none.
See also
Sources
Referenced by
Practice questions optional · AI
Generate fresh practice questions about this concept with AI. These are not vault-verified.