Mastering Extended Thinking in Claude: A Complete Guide to Adaptive Thinking and Manual Modes
Learn how to enable and optimize Claude's extended thinking for complex reasoning tasks. Covers adaptive thinking, manual mode, effort parameters, and model-specific behaviors.
This guide explains how to use Claude's extended thinking feature to enhance reasoning for complex 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 content blocks in your API responses.
Introduction
Claude's extended thinking feature unlocks a new level of reasoning capability, allowing the model to "think through" complex problems step-by-step before delivering a final answer. Whether you're building a research assistant, a code analysis tool, or a multi-step reasoning agent, extended thinking gives you both power and transparency into Claude's internal process.
This guide covers everything you need to know to implement extended thinking in your applications — from the basics of enabling it to advanced configuration with adaptive thinking and effort parameters.
How Extended Thinking Works
When extended thinking is enabled, Claude generates thinking content blocks that contain its internal reasoning. These blocks appear in the API response before the final text content blocks. Each thinking block includes:
type: Always"thinking"thinking: The actual reasoning textsignature: A cryptographic signature for verification
{
"content": [
{
"type": "thinking",
"thinking": "Let me break this problem down step by step...",
"signature": "WaUjzkypQ2mUEVM36O2TxuC06KN8xyfbJwyem2dw3URve/op91XWHOEBLLqIOMfFG/UvLEczmEsUjavL...."
},
{
"type": "text",
"text": "Based on my analysis, the answer is..."
}
]
}
Adaptive Thinking vs. Manual Extended Thinking
Claude offers two modes for extended thinking. The right choice depends on your model version and use case.
Adaptive Thinking (Recommended)
Adaptive thinking (thinking: {type: "adaptive"}) lets Claude dynamically decide how much reasoning to use based on the complexity of the task. This is the only supported mode for Claude Opus 4.7 and is strongly recommended for all other models.
With adaptive thinking, you can optionally set an effort parameter to control how much reasoning Claude applies:
| Effort Level | Description |
|---|---|
"low" | Minimal reasoning — fast responses for simple tasks |
"medium" | Balanced reasoning — good for most use cases |
"high" | Maximum reasoning — best for complex, multi-step problems |
Manual Extended Thinking (Deprecated)
Manual mode (thinking: {type: "enabled", budget_tokens: N}) requires you to specify a fixed token budget for reasoning. While still functional on Claude Opus 4.6 and Claude Sonnet 4.6, it is deprecated and will be removed in future releases.
Model-Specific Behavior
Different Claude models handle extended thinking differently:
| Model | Adaptive Thinking | Manual Mode | Notes |
|---|---|---|---|
| Claude Opus 4.7 | ✅ Required | ❌ Returns 400 error | Use effort parameter |
| Claude Opus 4.6 | ✅ Recommended | ✅ Deprecated but functional | — |
| Claude Sonnet 4.6 | ✅ Recommended | ✅ Deprecated but functional | Interleaved mode deprecated |
| Claude Mythos Preview | ✅ Default | ✅ Accepted | thinking: {type: "disabled"} not supported; use display: "summarized" for summaries |
How to Use Extended Thinking in the API
Python Example (Adaptive Thinking)
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=4096,
thinking={
"type": "adaptive",
"effort": "high" # Options: "low", "medium", "high"
},
messages=[
{
"role": "user",
"content": "Analyze the ethical implications of using AI in healthcare diagnostics, considering patient privacy, accuracy, and accessibility."
}
]
)
Extract thinking and final response
for block in response.content:
if block.type == "thinking":
print("=== CLAUDE'S REASONING ===")
print(block.thinking)
elif block.type == "text":
print("=== FINAL ANSWER ===")
print(block.text)
TypeScript Example (Adaptive Thinking)
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic();
async function main() {
const response = await client.messages.create({
model: 'claude-opus-4-7',
max_tokens: 4096,
thinking: {
type: 'adaptive',
effort: 'high'
},
messages: [
{
role: 'user',
content: 'Compare and contrast the economic policies of Keynesian economics and Monetarism.'
}
]
});
for (const block of response.content) {
if (block.type === 'thinking') {
console.log('=== REASONING ===');
console.log(block.thinking);
} else if (block.type === 'text') {
console.log('=== ANSWER ===');
console.log(block.text);
}
}
}
main();
Python Example (Manual Mode — Legacy)
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-6", # Manual mode not supported on Opus 4.7
max_tokens=4096,
thinking={
"type": "enabled",
"budget_tokens": 2048 # Maximum tokens for reasoning
},
messages=[
{
"role": "user",
"content": "Solve this complex math problem: integrate x^2 * sin(x) dx"
}
]
)
Best Practices for Extended Thinking
1. Choose the Right Effort Level
- Low effort: Use for simple tasks like basic Q&A or straightforward data extraction.
- Medium effort: Good for most analytical tasks, code reviews, and moderate reasoning.
- High effort: Reserve for complex problem-solving, multi-step analysis, or tasks requiring deep reasoning.
2. Handle Thinking Blocks in Your Application
When streaming responses, thinking blocks appear as separate events. Make sure your UI or processing logic can distinguish between thinking and text content:
# Streaming example
with client.messages.stream(
model="claude-opus-4-7",
max_tokens=4096,
thinking={"type": "adaptive", "effort": "high"},
messages=[{"role": "user", "content": "Explain quantum computing in simple terms."}]
) as stream:
for event in stream:
if event.type == "content_block_start" and event.content_block.type == "thinking":
print("\n[Claude is thinking...]")
elif event.type == "content_block_delta" and event.delta.type == "thinking_delta":
# Accumulate thinking text
pass
elif event.type == "content_block_delta" and event.delta.type == "text_delta":
print(event.delta.text, end="")
3. Respect Token Budgets
Even with adaptive thinking, Claude has a maximum token limit for reasoning. If you need more reasoning capacity, increase max_tokens in your request. The thinking budget is always a portion of the total max_tokens.
4. Use Signatures for Verification
The signature field in thinking blocks allows you to cryptographically verify that the thinking content hasn't been tampered with. This is especially important for applications where auditability matters (e.g., legal, medical, financial analysis).
Common Pitfalls and Solutions
| Problem | Solution |
|---|---|
| 400 error on Opus 4.7 | Switch from type: "enabled" to type: "adaptive" |
| Thinking content too long | Reduce effort level or increase max_tokens |
| No thinking blocks in response | Ensure extended thinking is enabled and model supports it |
| Streaming issues | Handle content_block_start and content_block_delta events for thinking blocks |
Key Takeaways
- Adaptive thinking (
type: "adaptive") is the modern, recommended approach — use it with theeffortparameter to control reasoning depth. - Manual mode (
type: "enabled") is deprecated and not supported on Claude Opus 4.7 — migrate to adaptive thinking. - Model compatibility matters: Always check which mode your target model supports before implementing.
- Handle thinking blocks in your application logic to display or process Claude's reasoning separately from the final answer.
- Use the
effortparameter wisely: low for speed, high for deep reasoning. Start with"medium"and adjust based on your task complexity.