Skip to content

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 its tool_result; modifying or omitting it returns an error.
  • The API uses cryptographic signatures; tampering with a thinking block errors out.
  • tool_choice: any and tool_choice: tool are NOT compatible with extended thinking — only auto (default) and none work.
  • 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_result requires echoing the full signed thinking block. Also tests the any/tool incompatibility 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; use auto/none.

See also

Sources