CONCEPT Claude reasons about which tool — and about what came back
Extended thinking (on current 4.x models this is adaptive thinking,
thinking: {"type": "adaptive"}) gives Claude a private reasoning scratchpad. Combined with
tools, that reasoning happens in two places: before a tool call, Claude thinks about
which tool to call and with what arguments; after a tool_result returns,
Claude thinks again — reasoning across the result — before deciding the next action or the final
answer. This second pass is interleaved thinking, and adaptive thinking turns it on
automatically (no beta header on 4.6+).
search() returned, notice the answer is incomplete, and reason its way to a second,
better-targeted call — rather than blindly firing a fixed sequence.CONCEPT Two rules the exam tests: replay signed blocks, and no forced tools
Thinking + tools comes with two hard constraints:
- Replay
thinkingblocks unchanged, with theirsignature. When you continue a tool-use conversation on the same model, the assistant turn you send back must include the originalthinkingblock(s) exactly as received — the opaquesignaturefield is a cryptographic seal. Editing, reconstructing, or dropping a signed block breaks the turn (the API rejects tampered blocks). You may read and display a summary; you may not alter the block. tool_choiceis limited toautoornonewhen thinking is on.{"type": "any"}and{"type": "tool", "name": …}are not supported with extended thinking and return an error — forcing a tool would require prefilling the assistant turn, which is incompatible with a thinking block leading the response.
user-message instruction instead, or drop thinking for that call.DIAGRAM Thinking wraps every tool round-trip
which tool? which args? C->>H: tool_use(search, ...) H->>C: tool_result Note over C: 🧠 interleaved thinking:
reason across the result C->>H: tool_use(fetch, ...) H->>C: tool_result Note over C: 🧠 thinking: enough to answer C->>U: final answer Note over H: replay ALL thinking blocks
+ signatures unchanged each turn
CODE Adaptive thinking + tools, then echo signed blocks back
First call enables adaptive thinking with tool_choice at its only legal values (auto).
The follow-up turn must carry the original thinking block and the tool_use
block back, unmodified, alongside the tool_result.
# 1) First request — thinking on, tool_choice must be auto/none resp = client.messages.create( model="claude-opus-4-8", max_tokens=16000, thinking={"type": "adaptive"}, # interleaved thinking auto-on tools=tools, tool_choice={"type": "auto"}, # 'any'/'tool' would 400 here messages=[{"role": "user", "content": "What changed in the Q3 report?"}], ) # resp.content = [ thinking(signature=...), tool_use(id=..., name="search") ] tool_use = next(b for b in resp.content if b.type == "tool_use") result = run_tool(tool_use.name, tool_use.input) # 2) Continue — replay resp.content VERBATIM (thinking block + signature intact) resp2 = client.messages.create( model="claude-opus-4-8", max_tokens=16000, thinking={"type": "adaptive"}, tools=tools, messages=[ {"role": "user", "content": "What changed in the Q3 report?"}, {"role": "assistant", "content": resp.content}, # ← unchanged, signed {"role": "user", "content": [{ "type": "tool_result", "tool_use_id": tool_use.id, "content": result, }]}, ], )
TRADE-OFFS Interleaved reasoning vs. its constraints
✅ Thinking + tools
- Claude reasons across results, not just before the first call
- Smarter multi-step chains: adapts the next call to what came back
- Fewer wasted / redundant tool calls on hard, ambiguous tasks
⚠️ The price
- Must replay every
thinkingblock +signatureunchanged - Can't force a tool (
any/toolerror) — onlyauto/none - More output tokens; thinking is billed even when its text is
omitted
EXAM TRAPS
tool_choice: any / tool error with thinking; only auto and
none are compatible.thinking blocks before the next turn to
"save tokens." → The signature is a seal; altered or missing signed blocks break the continuation.
Replay them verbatim on the same model.tool_result (interleaved) — that's the whole point.budget_tokens to bound thinking on Opus 4.8. → Removed on
4.7/4.8 (400). Use thinking: {"type":"adaptive"} and steer depth with
output_config.effort.PRACTICE
Q1 · Why must you send the assistant's thinking block back on the next turn?
Because on the same model Claude expects its prior reasoning — sealed by an opaque
signature — to be replayed unchanged. It uses the signed block to continue coherently;
tampering with or dropping it makes the API reject the turn. You can display a summary, but never edit the block.
Q2 · A teammate sets tool_choice:{"type":"tool","name":"lookup"} with adaptive
thinking and gets an error. Why?
Forced tool use (any or tool) is incompatible with extended thinking —
forcing a tool prefills the assistant turn, which can't coexist with a leading thinking block. Only
auto (default) and none work. To bias selection, put "use the lookup tool" in a
user message.
Q3 · What is "interleaved" thinking and what does it buy you?
Thinking that occurs between tool calls — after each tool_result Claude
reasons again before its next move. It buys smarter multi-step behavior: Claude can notice a partial result and
reformulate the next call instead of following a fixed script.