BeClaude
GuideBeginnerAPI2026-05-22

Mastering Extended Thinking in Claude: Adaptive vs. Manual Thinking for Complex Reasoning

Learn how to use Claude's extended thinking feature for enhanced reasoning. Covers adaptive thinking, manual mode, effort parameters, and code examples for API integration.

Quick Answer

This guide explains how to enable and configure Claude's extended thinking for complex reasoning tasks. You'll learn the difference between adaptive thinking (recommended for Opus 4.7) and manual mode, how to set effort levels, and how to handle thinking blocks in API responses.

extended thinkingadaptive thinkingClaude APIreasoningcomplex tasks

Introduction

Claude's extended thinking feature unlocks enhanced reasoning capabilities for complex tasks. When enabled, Claude generates internal reasoning steps before delivering its final answer, giving you visibility into its thought process. This is invaluable for mathematical proofs, multi-step analysis, code debugging, and any task requiring deep logical chains.

However, the implementation differs across Claude model versions. With the release of Claude Opus 4.7, the traditional manual extended thinking mode (thinking: {type: "enabled", budget_tokens: N}) is no longer supported. Instead, Anthropic introduced adaptive thinking with an effort parameter. This guide covers both approaches, when to use each, and practical code examples.

How Extended Thinking Works

When extended thinking is enabled, Claude produces special thinking content blocks in the API response. These blocks contain its internal reasoning, followed by the final text content block. The response structure looks like this:

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

The signature field is used for verification and should not be modified. The thinking blocks can be streamed or returned in full, depending on your API call configuration.

Adaptive Thinking (Recommended for Opus 4.7)

Adaptive thinking is the new standard for Claude Opus 4.7 and is strongly recommended for Opus 4.6 and Sonnet 4.6. Instead of setting a fixed token budget, you specify an effort level that tells Claude how much reasoning to apply relative to the task complexity.

Effort Levels

The effort parameter accepts three values:

EffortDescription
"low"Minimal reasoning; good for simple tasks where speed matters
"medium"Balanced reasoning; suitable for most complex tasks
"high"Maximum reasoning; best for proofs, deep analysis, or ambiguous problems

API Example (Python)

import anthropic

client = anthropic.Anthropic()

response = client.messages.create( model="claude-opus-4-7", max_tokens=16000, thinking={ "type": "adaptive", "effort": "high" }, messages=[ { "role": "user", "content": "Prove that there are infinitely many prime numbers congruent to 3 modulo 4." } ] )

Print thinking blocks

for block in response.content: if block.type == "thinking": print(f"Thinking: {block.thinking[:500]}...") elif block.type == "text": print(f"Final answer: {block.text}")

API Example (TypeScript)

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

const client = new Anthropic();

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

for (const block of response.content) { if (block.type === 'thinking') { console.log(Thinking: ${block.thinking.substring(0, 500)}...); } else if (block.type === 'text') { console.log(Final answer: ${block.text}); } }

Manual Extended Thinking (Deprecated for Opus 4.7)

Manual extended thinking uses thinking: {type: "enabled", budget_tokens: N} where you specify the exact number of tokens Claude can use for reasoning. This mode is still functional on Claude Opus 4.6 and Claude Sonnet 4.6, but it is deprecated and will be removed in a future model release.

Important: On Claude Opus 4.7, manual mode returns a 400 error. Always use adaptive thinking for Opus 4.7.

When to Use Manual Mode

  • You are using Claude Opus 4.6 or Sonnet 4.6 and need precise control over reasoning token allocation.
  • You have existing code that relies on budget_tokens and you cannot immediately migrate to adaptive thinking.
  • You are using Claude Mythos Preview, which accepts manual mode and defaults to adaptive thinking.

API Example (Manual Mode)

import anthropic

client = anthropic.Anthropic()

response = client.messages.create( model="claude-sonnet-4-6", max_tokens=16000, thinking={ "type": "enabled", "budget_tokens": 10000 }, messages=[ { "role": "user", "content": "Explain the Riemann Hypothesis in simple terms." } ] )

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

Model-Specific Behavior

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

ModelAdaptive ThinkingManual ModeNotes
Claude Opus 4.7✅ Required❌ Returns 400 errorUse effort parameter
Claude Opus 4.6✅ Recommended✅ Deprecated but functionalMigrate to adaptive soon
Claude Sonnet 4.6✅ Recommended✅ Deprecated (interleaved mode)Migrate to adaptive soon
Claude Mythos Preview✅ Default✅ Acceptedthinking: {type: "disabled"} not supported; display defaults to "omitted"

Streaming with Extended Thinking

Extended thinking works seamlessly with streaming. When streaming, thinking blocks are delivered as content_block_delta events with type: "thinking_delta". You can accumulate the thinking text as it arrives.

import anthropic

client = anthropic.Anthropic()

with client.messages.stream( model="claude-opus-4-7", max_tokens=16000, thinking={ "type": "adaptive", "effort": "high" }, messages=[ { "role": "user", "content": "Solve this equation step by step: 3x^2 + 5x - 2 = 0" } ] ) 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="")

Best Practices

  • Use adaptive thinking for Opus 4.7 – Manual mode will fail with a 400 error. Always use thinking: {type: "adaptive", effort: "..."}.
  • Start with medium effort – For most complex tasks, "medium" provides a good balance of reasoning depth and response speed. Only use "high" for tasks that genuinely require deep logical chains.
  • Set max_tokens appropriately – The max_tokens parameter must be greater than the thinking budget (or effort's implied budget). A good rule of thumb is max_tokens = budget_tokens + 2000 for manual mode, or at least 16000 for adaptive high effort.
  • Handle thinking blocks in your UI – If you're building a chat interface, consider displaying thinking blocks in a collapsible section so users can optionally view Claude's reasoning.
  • Migrate from manual to adaptive – If you're using Opus 4.6 or Sonnet 4.6 with manual mode, plan to migrate to adaptive thinking before the next model update.

Key Takeaways

  • Adaptive thinking (thinking: {type: "adaptive", effort: "..."}) is the recommended approach for Claude Opus 4.7 and newer models. It uses an effort level (low/medium/high) instead of a fixed token budget.
  • Manual extended thinking (thinking: {type: "enabled", budget_tokens: N}) is deprecated on Opus 4.6 and Sonnet 4.6, and returns a 400 error on Opus 4.7. Migrate to adaptive thinking as soon as possible.
  • Claude Mythos Preview defaults to adaptive thinking and does not support disabling thinking entirely. Use display: "summarized" to receive summaries instead of full thinking blocks.
  • Streaming is fully supported with extended thinking. Listen for thinking_delta events to stream reasoning tokens in real time.
  • Always set max_tokens high enough to accommodate both thinking and final response. For adaptive high effort, 16000 tokens is a safe starting point.