BeClaude
GuideBeginnerAPI2026-05-19

Mastering Extended Thinking in Claude: A Practical Guide to Adaptive & Manual Reasoning

Learn how to enable and optimize Claude's extended thinking for complex reasoning tasks. Covers adaptive thinking, effort parameters, manual mode, and code examples.

Quick Answer

This guide explains how to use Claude's extended thinking feature to get step-by-step reasoning before final answers. You'll learn about adaptive thinking (recommended for Opus 4.7), manual mode (deprecated but still functional on older models), and how to control reasoning depth with the effort parameter.

extended thinkingadaptive thinkingClaude APIreasoningeffort parameter

Introduction

Claude's extended thinking feature unlocks a new level of reasoning capability by allowing the model to generate internal thought processes before producing a final answer. This is especially valuable for complex tasks like mathematical proofs, multi-step analysis, code debugging, and strategic planning.

In this guide, you'll learn:

  • What extended thinking is and how it works under the hood
  • The difference between adaptive thinking (new default) and manual extended thinking (deprecated)
  • How to configure the effort parameter to control reasoning depth
  • Practical code examples in Python and TypeScript
  • Best practices for maximizing performance and avoiding common pitfalls

How Extended Thinking Works

When extended thinking is enabled, Claude produces thinking content blocks in the API response. These blocks contain the model's internal reasoning, followed by the final text content block. The thinking blocks are signed for verification and can be displayed or summarized depending on your configuration.

Example response structure:

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

Adaptive Thinking (Recommended for Claude Opus 4.7)

Starting with Claude Opus 4.7, manual extended thinking (thinking: {type: "enabled", budget_tokens: N}) is no longer supported and returns a 400 error. Instead, you must use adaptive thinking with the effort parameter.

Adaptive thinking automatically determines how much reasoning is needed based on the complexity of the task. You control the maximum effort Claude should expend, and the model decides how much of that budget to actually use.

Effort Parameter

The effort parameter accepts values from 0.0 to 1.0:

  • 0.0 – Minimal reasoning (fast, low cost)
  • 0.5 – Balanced reasoning (default)
  • 1.0 – Maximum reasoning (slow, high cost, best for hard problems)

Python Example

import anthropic

client = anthropic.Anthropic()

response = client.messages.create( model="claude-opus-4-7", max_tokens=32000, thinking={ "type": "adaptive", "effort": 0.7 # High effort for complex reasoning }, messages=[ { "role": "user", "content": "Prove that there are infinitely many prime numbers congruent to 3 mod 4." } ] )

for block in response.content: if block.type == "thinking": print(f"Thinking: {block.thinking}") elif block.type == "text": print(f"Answer: {block.text}")

TypeScript Example

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

const client = new Anthropic();

const response = await client.messages.create({ model: 'claude-opus-4-7', max_tokens: 32000, thinking: { type: 'adaptive', effort: 0.7 }, messages: [ { role: 'user', content: 'Prove that there are infinitely many prime numbers congruent to 3 mod 4.' } ] });

for (const block of response.content) { if (block.type === 'thinking') { console.log(Thinking: ${block.thinking}); } else if (block.type === 'text') { console.log(Answer: ${block.text}); } }

Manual Extended Thinking (Deprecated but Still Functional)

For Claude Opus 4.6 and Claude Sonnet 4.6, manual extended thinking is deprecated but still works. You should migrate to adaptive thinking as soon as possible.

Manual mode requires you to set a budget_tokens value, which defines the maximum number of tokens Claude can use for reasoning before generating the final answer.

Python Example (Manual Mode)

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=16000,
    thinking={
        "type": "enabled",
        "budget_tokens": 10000  # Claude will use up to 10K tokens for thinking
    },
    messages=[
        {
            "role": "user",
            "content": "Explain the Riemann Hypothesis in simple terms."
        }
    ]
)
Note: budget_tokens must be less than max_tokens. A good rule of thumb is to set budget_tokens to about 60–80% of max_tokens.

Model-Specific Behavior

Different Claude models handle extended thinking differently:

ModelAdaptive ThinkingManual ModeNotes
Claude Opus 4.7✅ Required❌ Returns 400 errorUse thinking: {type: "adaptive", effort: N}
Claude Opus 4.6✅ Recommended✅ DeprecatedMigrate to adaptive
Claude Sonnet 4.6✅ Recommended✅ Deprecated (interleaved)Migrate to adaptive
Claude Mythos Preview✅ Default✅ Acceptedthinking: {type: "disabled"} not supported; use display: "summarized" for summaries

Claude Mythos Preview Special Behavior

For Claude Mythos Preview, adaptive thinking is the default. You cannot disable it. If you want to receive summarized thinking instead of full thinking blocks, pass display: "summarized":

response = client.messages.create(
    model="claude-mythos-preview",
    max_tokens=32000,
    thinking={
        "type": "adaptive",
        "display": "summarized"
    },
    messages=[...]
)

Best Practices

1. Choose the Right Effort Level

  • Low effort (0.0–0.3): Use for simple Q&A, factual lookups, or when speed matters.
  • Medium effort (0.4–0.7): Use for analysis, code review, or multi-step reasoning.
  • High effort (0.8–1.0): Use for mathematical proofs, complex logic puzzles, or strategic planning.

2. Set Appropriate Token Limits

With adaptive thinking, you still need max_tokens to be high enough to accommodate both thinking and final output. A safe starting point is:

  • max_tokens: 16000–32000 for complex tasks
  • max_tokens: 4000–8000 for simpler tasks

3. Handle Thinking Blocks in Your Application

If you display thinking to users, consider:

  • Summarizing long thinking blocks to avoid overwhelming the user
  • Streaming thinking blocks as they arrive for a more responsive experience
  • Stripping thinking blocks from the final output if you only need the answer

4. Migrate from Manual to Adaptive

If you're currently using manual extended thinking (type: "enabled"), update your code to use adaptive thinking:

Before (deprecated):
thinking={"type": "enabled", "budget_tokens": 10000}
After (recommended):
thinking={"type": "adaptive", "effort": 0.6}

Common Pitfalls

  • Setting budget_tokens too high – If budget_tokens exceeds max_tokens, the API returns an error. Always ensure budget_tokens < max_tokens.
  • Using manual mode on Opus 4.7 – This returns a 400 error. Switch to adaptive thinking.
  • Expecting thinking blocks on Mythos Preview with type: "disabled" – Not supported. Use display: "summarized" if you want summaries.
  • Ignoring the signature field – The signature is useful for verifying the integrity of thinking blocks, especially in enterprise or audit scenarios.

Key Takeaways

  • Adaptive thinking (type: "adaptive") is the modern, recommended approach. It automatically adjusts reasoning depth based on task complexity.
  • Manual extended thinking (type: "enabled") is deprecated on Opus 4.6 and Sonnet 4.6, and not supported on Opus 4.7. Migrate to adaptive thinking.
  • The effort parameter (0.0–1.0) lets you control how much reasoning Claude performs. Higher effort = better results for hard problems, but slower and more expensive.
  • Always set max_tokens high enough to accommodate both thinking and final output. A good starting point is 16000–32000 tokens.
  • Handle thinking blocks appropriately in your application—stream them, summarize them, or strip them depending on your use case.