Mastering Claude's Extended Thinking: From Manual Control to Adaptive Reasoning
Learn how to leverage Claude's extended thinking capabilities for complex reasoning tasks. Covers adaptive thinking, effort parameters, and practical API implementation across all supported models.
This guide teaches you how to enable and optimize Claude's extended thinking feature for complex reasoning tasks. You'll learn the difference between manual and adaptive thinking modes, how to use the effort parameter, and best practices for implementing thinking blocks in your applications.
Mastering Claude's Extended Thinking: From Manual Control to Adaptive Reasoning
Claude's extended thinking capability is one of its most powerful features for tackling complex problems. It allows the model to engage in deep, step-by-step reasoning before delivering a final answer—and optionally shows you its thought process along the way. This guide covers everything you need to know to implement and optimize extended thinking in your Claude-powered applications.
What Is Extended Thinking?
Extended thinking gives Claude enhanced reasoning capabilities for complex tasks. When enabled, Claude generates internal reasoning steps ("thinking" content blocks) that it uses to inform its final response. The API returns these thinking blocks alongside the final text output, providing varying levels of transparency into Claude's reasoning process.
This feature is especially valuable for:
- Mathematical proofs and complex calculations
- Multi-step logical reasoning
- Code generation with intricate logic
- Analysis requiring careful consideration of multiple factors
- Any task where you want to verify Claude's reasoning path
Understanding the Two Thinking Modes
Claude offers two approaches to extended thinking, and the right choice depends on your model and use case.
Adaptive Thinking (Recommended)
Adaptive thinking lets Claude dynamically decide how much reasoning to apply based on the complexity of the task. You don't set a fixed token budget—Claude allocates thinking tokens as needed. This is the modern, recommended approach for all current models.
Key parameter:effort – Controls how much reasoning Claude applies:
"low"– Minimal reasoning, faster responses"medium"– Balanced reasoning (default)"high"– Maximum reasoning for complex tasks
Manual Extended Thinking (Legacy)
Manual extended thinking requires you to specify a fixed budget_tokens value. While still functional on some older models, this approach is deprecated and will be removed in future releases.
thinking: {type: "enabled", budget_tokens: N}) is no longer supported on Claude Opus 4.7 and later models. Using it will return a 400 error.
Model Compatibility Guide
Here's a quick reference for which thinking mode works with each model:
| Model | Recommended Mode | Manual Mode Support |
|---|---|---|
| Claude Opus 4.7+ | Adaptive only | ❌ Returns 400 error |
| Claude Opus 4.6 | Adaptive | ✅ Deprecated, functional |
| Claude Sonnet 4.6 | Adaptive | ✅ Deprecated, functional |
| Claude Mythos Preview | Adaptive (default) | ✅ Accepted |
| Claude Sonnet 3.7 | Manual | ✅ Supported |
How to Implement Extended Thinking
Basic Implementation with Adaptive Thinking
Here's how to enable adaptive thinking with the Claude API using Python:
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 there are infinitely many prime numbers congruent to 3 modulo 4."
}
]
)
Access thinking blocks and text blocks
for block in response.content:
if block.type == "thinking":
print(f"Thinking: {block.thinking[:200]}...")
print(f"Signature: {block.signature}")
elif block.type == "text":
print(f"Final answer: {block.text}")
TypeScript Implementation
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: 'Design an algorithm to detect cycles in a directed graph.'
}
]
});
for (const block of response.content) {
if (block.type === 'thinking') {
console.log(Thinking: ${block.thinking.substring(0, 200)}...);
} else if (block.type === 'text') {
console.log(Answer: ${block.text});
}
}
Working with Manual Extended Thinking (Legacy Models)
For models that still support manual mode (like Claude Sonnet 3.7):
response = client.messages.create(
model="claude-sonnet-3-7",
max_tokens=20000,
thinking={
"type": "enabled",
"budget_tokens": 12000 # Reserve 12K tokens for thinking
},
messages=[
{
"role": "user",
"content": "Explain the P vs NP problem and its implications."
}
]
)
Important: When using manual mode, budget_tokens must be less than max_tokens. The thinking budget reserves tokens for reasoning, while the remaining tokens are used for the final response.
Understanding the Response Format
When extended thinking is enabled, the API response contains a content array with two types of blocks:
- Thinking blocks (
type: "thinking") – Contains Claude's internal reasoning and a cryptographic signature - Text blocks (
type: "text") – The final response informed by the thinking process
{
"content": [
{
"type": "thinking",
"thinking": "Let me analyze this step by step...",
"signature": "WaUjzkypQ2mUEVM36O2TxuC06KN8xyfbJwyem2dw3URve/op91XWHOEBLLqIOMfFG/UvLEczmEsUjavL...."
},
{
"type": "text",
"text": "Based on my analysis, the answer is..."
}
]
}
The signature field is a cryptographic proof of the thinking content, which can be used for verification purposes.
Advanced Configuration Options
Task Budgets (Beta)
For adaptive thinking, you can optionally set a task budget to constrain the maximum thinking tokens:
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={
"type": "adaptive",
"effort": "high",
"task_budget": 8000 # Optional: cap thinking at 8K tokens
},
messages=[...]
)
Fast Mode (Research Preview)
Fast mode trades some reasoning depth for significantly faster responses. Useful for time-sensitive applications:
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={
"type": "adaptive",
"effort": "medium",
"fast_mode": True # Enable faster, lighter reasoning
},
messages=[...]
)
Display Options for Claude Mythos Preview
Claude Mythos Preview has unique display behavior. By default, thinking content is omitted from responses. To receive summaries:
response = client.messages.create(
model="claude-mythos-preview",
max_tokens=16000,
thinking={
"type": "adaptive",
"display": "summarized" # Receive thinking summaries
},
messages=[...]
)
Best Practices
1. Choose the Right Effort Level
- Low effort: Use for simple tasks where you need quick, straightforward answers
- Medium effort: Default for most applications—balances speed and depth
- High effort: Reserve for complex problems requiring thorough analysis
2. Set Appropriate max_tokens
Extended thinking consumes tokens from your max_tokens budget. For complex tasks:
- Allocate 60-80% of tokens for thinking (especially in manual mode)
- Ensure remaining tokens are sufficient for the final response
3. Handle Thinking Blocks in Your Application
When displaying responses to users, consider how you present thinking blocks:
- Show them in collapsible sections for transparency
- Use them for debugging and verification
- Consider omitting them in production for cleaner UX
4. Migrate from Manual to Adaptive
If you're currently using manual extended thinking:
- Check your model compatibility
- Replace
type: "enabled"withtype: "adaptive" - Replace
budget_tokenswith theeffortparameter - Test thoroughly—adaptive thinking may produce different reasoning patterns
Common Pitfalls to Avoid
- Using manual mode on Claude Opus 4.7+: This will return a 400 error. Always use adaptive thinking for these models.
- Setting budget_tokens >= max_tokens: This leaves no room for the final response and will cause errors.
- Ignoring the signature field: The signature is important for verifying thinking content integrity.
- Assuming all models behave identically: Review the model-specific documentation for nuances.
Key Takeaways
- Adaptive thinking is the future: Use
thinking: {type: "adaptive", effort: "..."}for all current models. Manual mode is deprecated and removed on Claude Opus 4.7+. - The effort parameter controls reasoning depth: Choose
"low","medium", or"high"based on task complexity. Medium is a good default for most use cases. - Extended thinking returns two block types:
thinkingblocks contain reasoning with cryptographic signatures, whiletextblocks contain the final answer. - Model compatibility matters: Always check which thinking mode your target model supports. Claude Opus 4.7+ requires adaptive thinking exclusively.
- Token budgeting is critical: In manual mode, ensure
budget_tokens < max_tokens. In adaptive mode, use optionaltask_budgetto cap thinking token usage.