BeClaude
Guide2026-05-06

Mastering Claude's Extended Thinking: A Practical Guide to Enhanced Reasoning

Learn how to use Claude's extended thinking feature for complex tasks. Covers adaptive thinking, effort parameter, manual mode, and practical API examples for Claude 4 and Opus models.

Quick Answer

Extended thinking gives Claude enhanced reasoning capabilities for complex tasks, allowing it to show step-by-step reasoning before delivering final answers. Use adaptive thinking with the effort parameter for Claude Opus 4.7+, or manual mode for older models.

extended thinkingClaude APIadaptive thinkingreasoningClaude Opus

Mastering Claude's Extended Thinking: A Practical Guide to Enhanced Reasoning

Claude's extended thinking feature is one of the most powerful tools in the AI ecosystem for tackling complex, multi-step problems. Whether you're analyzing mathematical proofs, debugging intricate code, or reasoning through logical puzzles, extended thinking gives Claude the ability to "think out loud" before delivering its final answer. This guide will walk you through everything you need to know to use extended thinking effectively.

What Is Extended Thinking?

Extended thinking enables Claude to perform deep, step-by-step reasoning before generating its final response. Instead of jumping straight to an answer, Claude produces thinking content blocks that reveal its internal reasoning process. These blocks appear in the API response before the final text output, giving you transparency into how Claude arrived at its conclusion.

This feature is especially valuable for:

  • Mathematical proofs and complex calculations
  • Multi-step logical reasoning
  • Code analysis and debugging
  • Strategic planning and decision-making
  • Any task that benefits from visible chain-of-thought reasoning

Adaptive Thinking vs. Manual Extended Thinking

Claude offers two approaches to extended thinking, and the right choice depends on which model you're using.

Adaptive Thinking (Recommended for Claude Opus 4.7+)

For Claude Opus 4.7 and later models, adaptive thinking is the only supported mode. Instead of setting a fixed token budget, you use the effort parameter to control how much Claude should think:

import anthropic

client = anthropic.Anthropic()

response = client.messages.create( model="claude-opus-4-7", max_tokens=32000, thinking={"type": "adaptive", "effort": "high"}, messages=[ { "role": "user", "content": "Prove that there are infinitely many prime numbers of the form 4k+3." } ] )

The effort parameter accepts values like "low", "medium", and "high", letting you balance reasoning depth with response speed and token usage.

Manual Extended Thinking (Legacy, for Older Models)

For Claude Opus 4.6, Claude Sonnet 4.6, and earlier models, you can still use manual extended thinking with a fixed token budget:

import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic();

const response = await client.messages.create({ model: "claude-sonnet-4-6", max_tokens: 16000, thinking: { type: "enabled", budget_tokens: 10000 }, messages: [ { role: "user", content: "Explain the P vs NP problem and its implications for cryptography." } ] });

Important: Manual extended thinking (thinking: {type: "enabled", budget_tokens: N}) is deprecated on Claude Opus 4.6 and Claude Sonnet 4.6, and will be removed in a future release. Migrate to adaptive thinking as soon as possible.

Understanding the API Response

When extended thinking is enabled, the API response includes both thinking blocks and text blocks. Here's what the response structure looks like:

{
  "content": [
    {
      "type": "thinking",
      "thinking": "Let me analyze this step by step...",
      "signature": "WaUjzkypQ2mUEVM36O2TxuC06KN8xyfbJwyem2dw3URve/op91XWHOEBLLqIOMfFG/UvLEczmEsUjavL...."
    },
    {
      "type": "text",
      "text": "Based on my analysis..."
    }
  ]
}

Key elements:

  • thinking block: Contains Claude's internal reasoning. The signature field is used for verification.
  • text block: Contains the final answer, incorporating insights from the thinking process.

Model-Specific Behavior

Different Claude models handle extended thinking differently. Here's a quick reference:

ModelRecommended ModeNotes
Claude Opus 4.7+Adaptive (type: "adaptive")Manual mode returns 400 error
Claude Mythos PreviewAdaptive (default)Manual mode also accepted; type: "disabled" not supported
Claude Opus 4.6Adaptive (recommended)Manual mode deprecated but functional
Claude Sonnet 4.6Adaptive (recommended)Manual mode deprecated, interleaved mode available
Claude Sonnet 3.7Manual (type: "enabled")Uses legacy format

Special Case: Claude Mythos Preview

Claude Mythos Preview has unique behavior:

  • Adaptive thinking is the default
  • thinking: {type: "disabled"} is not supported
  • The display defaults to "omitted" (no thinking content returned)
  • Pass display: "summarized" to receive thinking summaries
response = client.messages.create(
    model="claude-mythos-preview",
    max_tokens=32000,
    thinking={"type": "adaptive", "effort": "high"},
    messages=[...]
)

Practical Tips for Using Extended Thinking

1. Set Appropriate max_tokens

Always set max_tokens higher than your thinking budget. The total tokens consumed include both thinking and final output. A good rule of thumb:

max_tokens = budget_tokens * 1.5 + 2000

2. Use Adaptive Thinking for Simplicity

With adaptive thinking, you don't need to worry about token budgets. Just set the effort level and let Claude decide how much to think:

# Adaptive thinking - no budget needed
thinking={"type": "adaptive", "effort": "high"}

3. Handle Thinking Blocks in Your Code

When processing responses, iterate over content blocks to handle thinking and text separately:

for block in response.content:
    if block.type == "thinking":
        print(f"Thinking: {block.thinking[:200]}...")  # Preview first 200 chars
    elif block.type == "text":
        print(f"Answer: {block.text}")

4. Streaming with Extended Thinking

Extended thinking works with streaming. When streaming, thinking blocks appear as content_block_delta events with type thinking_delta:

with client.messages.stream(
    model="claude-opus-4-7",
    max_tokens=32000,
    thinking={"type": "adaptive", "effort": "high"},
    messages=[{"role": "user", "content": "Explain quantum entanglement."}]
) as stream:
    for event in stream:
        if event.type == "content_block_delta" and event.delta.type == "thinking_delta":
            print(event.delta.thinking, end="")
        elif event.type == "content_block_delta" and event.delta.type == "text_delta":
            print(event.delta.text, end="")

5. Zero Data Retention (ZDR)

Extended thinking is eligible for Zero Data Retention (ZDR). If your organization has a ZDR arrangement, data sent through this feature is not stored after the API response is returned. This is important for sensitive or confidential tasks.

Common Pitfalls to Avoid

  • Using manual mode on Claude Opus 4.7+: This will return a 400 error. Always use adaptive thinking.
  • Setting budget_tokens too low: If your budget is too small, Claude may cut off its reasoning prematurely. Use adaptive thinking to avoid this.
  • Forgetting to set max_tokens: Extended thinking requires max_tokens to be set. The API will return an error if it's missing.
  • Ignoring the signature field: The signature is used for verification. Always include it if you need to verify the integrity of the thinking content.

Real-World Use Cases

Mathematical Proofs

Extended thinking excels at mathematical reasoning. Claude can show its step-by-step logic for proofs, derivations, and complex calculations.

Code Review and Debugging

When analyzing code, Claude can reason through potential bugs, edge cases, and optimizations before presenting its findings.

Strategic Analysis

For business or technical strategy, Claude can weigh pros and cons, consider multiple scenarios, and arrive at well-reasoned recommendations.

Scientific Research

Extended thinking helps Claude work through complex scientific concepts, experimental designs, and data analysis pipelines.

Key Takeaways

  • Use adaptive thinking (thinking: {type: "adaptive", "effort": "high"}) for Claude Opus 4.7+ and newer models. Manual mode is deprecated on older models.
  • Set max_tokens generously to accommodate both thinking and final output tokens.
  • Handle thinking blocks separately in your code to display or log reasoning content as needed.
  • Streaming is fully supported with extended thinking, enabling real-time display of Claude's reasoning process.
  • Extended thinking is ZDR-eligible, making it suitable for sensitive tasks where data retention is a concern.
By mastering extended thinking, you unlock Claude's full reasoning potential for the most demanding tasks. Start with adaptive thinking and experiment with different effort levels to find the right balance for your use case.