D4 · Prompt Engineering › Cluster 5 · Chain of Thought & Extended Thinking

5.3 · Extended Thinking vs Prompted CoT

Native reasoning budget

CONCEPT Reasoning as a first-class API capability

Extended thinking is a native capability: instead of coaxing step-by-step reasoning through prompt wording (5.1–5.2), you turn it on with the thinking parameter. The model then reasons in dedicated thinking content blocks that come back separate from the final text answer — no tags to write, no regex to strip. You control how much it reasons with a reasoning budget or an effort level.

🔑 Prompted CoT is you engineering the words. Extended thinking is the model doing genuine internal reasoning, returned in its own blocks with automatic optimization — Anthropic's docs note adaptive thinking reliably beats manual CoT on hard tasks.

CONCEPT Budget vs. effort — two ways to size the reasoning

How you dial the reasoning depends on the model generation:

ModeConfigApplies to
Manual budgetthinking: {type: "enabled", budget_tokens: N} — N must be < max_tokensOlder models (e.g. Opus 4.5, Haiku 4.5). Deprecated on 4.6; returns 400 on Opus 4.7/4.8, Sonnet 5, Fable 5.
Adaptive + effortthinking: {type: "adaptive"} + output_config: {effort: "low"|"medium"|"high"|"xhigh"|"max"}Current models. The model decides when/how much to think; effort tunes depth.

The response format is the same either way: thinking blocks (each carrying a signature) precede the text answer. A display setting ("summarized" vs "omitted") controls whether the reasoning text is surfaced — you're billed for the full thinking tokens regardless.

🚫 You cannot prefill the assistant turn while extended thinking is enabled. Putting words in Claude's mouth on the last assistant turn conflicts with native reasoning — the request is rejected. (Separately, prefill is unsupported on 4.6+ models entirely.) Use structured outputs or a clear instruction to shape the answer instead.

DIAGRAM Two roads to step-by-step reasoning

flowchart TD A["Task needs reasoning"] --> B{"Prompted CoT
or native thinking?"} B -->|"prompt wording"| C["Prompted CoT (5.1/5.2)
reasoning in the text body"] B -->|"thinking parameter"| D{"Which model?"} D -->|"older"| E["🔵 enabled + budget_tokens"] D -->|"current"| F["🟢 adaptive + effort"] E --> G["Separate 'thinking' blocks
+ signature, then 'text'"] F --> G G --> H["🚫 no assistant prefill
while thinking is on"] classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef mid fill:#cfe2ff,stroke:#0d6efd,color:#084298; classDef bad fill:#f8d7da,stroke:#dc3545,color:#721c24; class F ok; class E mid; class C mid; class H bad;

CODE Enable thinking, read the separate blocks

On current models, adaptive thinking + effort. The reasoning arrives as thinking blocks you can log or ignore; the answer is the text block.

# Current models: native reasoning, no prompt tricks, no prefill allowed.
resp = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=16000,
    thinking={"type": "adaptive"},          # native reasoning on
    output_config={"effort": "high"},        # tune depth: low..max
    messages=[{"role": "user", "content": "Prove there are infinitely many primes ≡ 3 (mod 4)."}],
)

for block in resp.content:
    if block.type == "thinking":
        log(block.thinking)          # separate reasoning block (+ block.signature)
    elif block.type == "text":
        show(block.text)              # the final answer

# Older models instead: thinking={"type": "enabled", "budget_tokens": 10000}
# (budget_tokens must be < max_tokens; 400 on Opus 4.7/4.8, Sonnet 5, Fable 5)
⚠️ Preserve thinking blocks (and their signature) unmodified when you send them back in a later turn — the signature is an integrity check and altering it returns a 400. This matters most during tool-use loops (see 5.4).

TRADE-OFFS Prompted CoT vs. extended thinking

✅ Extended thinking

  • Native reasoning; no prompt engineering
  • Reasoning in separate blocks — nothing to strip
  • Adaptive + effort auto-tunes depth to difficulty
  • Reasoning preserved across tool calls via signatures

⚠️ Costs & constraints

  • Thinking tokens are billed and add latency
  • No assistant prefill while enabled
  • Tool-use pairs it with constraints (5.4)
  • budget_tokens is gone on the newest models

EXAM TRAPS

Trap: Trying to prefill the assistant turn with thinking on. → Not allowed — the request is rejected. Shape the output with structured outputs or an instruction instead of a prefill.
Trap: Using budget_tokens on a current model. → It's deprecated on 4.6 and returns a 400 on Opus 4.7/4.8, Sonnet 5, and Fable 5. Use thinking: {type: "adaptive"} with effort.
Trap: Expecting the answer in content[0]. → With thinking on, the thinking block(s) come first; the answer is the text block — iterate and check block.type.
Trap: Editing or dropping the thinking block's signature before replaying it. → The signature must be passed back unmodified, or the API returns a 400.

PRACTICE

Q1 · A candidate sets budget_tokens on claude-opus-4-8 and gets a 400. Why?

Manual budget_tokens is removed on the newest models (Opus 4.7/4.8, Sonnet 5, Fable 5). Use thinking: {type: "adaptive"} and control depth with output_config: {effort: ...} instead.

Q2 · Why can't you prefill the assistant turn with extended thinking enabled?

Native reasoning generates the assistant turn's leading content itself, so a client-supplied prefill on that turn conflicts with it and the request is rejected. Use structured outputs or an explicit instruction to steer the answer's shape.

Q3 · How does the reasoning come back differently from prompted structured CoT?

Extended thinking returns reasoning in separate thinking content blocks (each with a signature), so you never tag or regex it out — you just read the text block. Structured CoT keeps reasoning inline in the response body inside tags you defined.