Mastering Extended Thinking in Claude: A Practical Guide to Adaptive and Manual Reasoning
Learn how to enable and optimize Claude's extended thinking feature for complex reasoning tasks, including adaptive thinking, effort parameters, and budget tokens.
This guide explains how to use Claude's extended thinking feature to enhance reasoning for complex tasks. You'll learn the difference between adaptive and manual thinking, how to configure effort and budget tokens, and how to handle thinking blocks in API responses.
Introduction
Claude's extended thinking feature unlocks a new level of reasoning capability. When enabled, Claude generates internal thought processes before producing its final answer, making it ideal for complex tasks like mathematical proofs, multi-step analysis, and logical puzzles. This guide covers everything you need to know to implement extended thinking effectively, from basic setup to advanced configuration.
How Extended Thinking Works
When extended thinking is active, Claude produces thinking content blocks in the API response. These blocks contain its step-by-step reasoning, followed by the final text response. The signature field ensures the integrity of the thinking process.
Here's what a typical response looks like:
{
"content": [
{
"type": "thinking",
"thinking": "Let me analyze this step by step...",
"signature": "WaUjzkypQ2mUEVM36O2TxuC06KN8xyfbJwyem2dw3URve/op91XWHOEBLLqIOMfFG/UvLEczmEsUjavL...."
},
{
"type": "text",
"text": "Based on my analysis..."
}
]
}
Adaptive Thinking vs. Manual Extended Thinking
Claude offers two modes for extended thinking:
- Adaptive thinking (
thinking: {type: "adaptive"}) – Claude automatically decides how much thinking to use. Recommended for most use cases. - Manual extended thinking (
thinking: {type: "enabled", budget_tokens: N}) – You set a fixed token budget for thinking. Deprecated on newer models.
Model Support
| Model | Adaptive Thinking | Manual Extended Thinking |
|---|---|---|
| Claude Opus 4.7 | ✅ Required | ❌ Returns 400 error |
| Claude Opus 4.6 | ✅ Recommended | ✅ Deprecated but functional |
| Claude Sonnet 4.6 | ✅ Recommended | ✅ Deprecated but functional |
| Claude Mythos Preview | ✅ Default | ✅ Accepted |
Important: For Claude Opus 4.7, you must use adaptive thinking. Manual extended thinking is no longer supported and will return a 400 error.
Using Adaptive Thinking with Effort
Adaptive thinking lets Claude decide how much reasoning to apply. You can guide this with the effort parameter:
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={
"type": "adaptive",
"effort": "high" # Options: "low", "medium", "high"
},
messages=[
{
"role": "user",
"content": "Prove that the square root of 2 is irrational."
}
]
)
for block in response.content:
if block.type == "thinking":
print(f"Thinking: {block.thinking}")
elif block.type == "text":
print(f"Answer: {block.text}")
Effort Levels
low– Minimal reasoning, faster responses for simpler tasks.medium– Balanced reasoning, good for most complex tasks.high– Maximum reasoning, best for deep analysis and proofs.
Manual Extended Thinking (Legacy)
For models that still support it, you can set a specific 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: 'Are there an infinite number of prime numbers such that n mod 4 == 3?'
}
]
});
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});
}
}
Budget Token Guidelines
- Set
budget_tokensto a value less thanmax_tokens. - A good starting point is 60-70% of your
max_tokensbudget. - For very complex tasks, you may need 80-90%.
Handling Thinking Blocks in Streaming
When streaming, thinking blocks appear as separate events. Here's how to handle them:
import anthropic
client = anthropic.Anthropic()
with client.messages.stream(
model="claude-sonnet-4-6",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[
{"role": "user", "content": "Explain quantum entanglement in simple terms."}
]
) 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 is not supported and will fail.
- Set appropriate effort levels – Start with
mediumand adjust based on task complexity. - Monitor token usage – Thinking tokens count toward your total token consumption.
- Handle signatures – Always verify the signature if you need to ensure thinking integrity.
- Stream for real-time feedback – Streaming gives you progressive visibility into Claude's reasoning.
Common Pitfalls
- Budget tokens exceed max_tokens – This will cause an error. Always keep
budget_tokens<max_tokens. - Using manual mode on Opus 4.7 – Returns a 400 error. Switch to adaptive thinking.
- Ignoring thinking blocks – The thinking content is part of the response; process it to understand Claude's reasoning.
Key Takeaways
- Adaptive thinking is the recommended approach for Claude Opus 4.7 and newer models; manual extended thinking is deprecated.
- Use the effort parameter (
low,medium,high) to control reasoning depth with adaptive thinking. - Budget tokens must always be less than
max_tokenswhen using manual mode on legacy models. - Streaming responses include separate events for thinking and text blocks – handle them accordingly.
- Verify signatures if you need to ensure the integrity of Claude's reasoning process.