Mastering Extended Thinking in Claude: A Practical Guide to Adaptive and Manual Reasoning
Learn how to enable and optimize Claude's extended thinking for complex reasoning tasks. Covers adaptive thinking, manual mode, effort parameters, and code examples for all supported models.
This guide explains how to use Claude's extended thinking feature to get step-by-step reasoning before final answers. You'll learn the difference between adaptive and manual thinking, how to set effort levels, and see working code examples for Claude Opus 4.7, Sonnet 4.6, and other models.
Introduction
Claude's extended thinking feature unlocks deeper reasoning for complex tasks. Instead of giving you just a final answer, Claude shows its step-by-step thought process—then delivers a polished response. This transparency helps you verify logic, debug prompts, and build more reliable AI applications.
Whether you're solving mathematical proofs, analyzing multi-step business problems, or building agents that need to reason before acting, extended thinking gives you both the journey and the destination.
How Extended Thinking Works
When you enable extended thinking, Claude produces thinking content blocks that contain its internal reasoning. These blocks appear before the final text response. The API response 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 streaming integrity. The thinking content is not returned when display is set to "summarized" or "omitted".
Adaptive Thinking vs. Manual Extended Thinking
Claude offers two modes for extended thinking:
Adaptive Thinking (Recommended)
Adaptive thinking lets Claude decide how much thinking to use based on the complexity of the task. You control the effort level instead of setting a fixed token budget. This is the only supported mode on Claude Opus 4.7.
Effort levels:"low"– Minimal reasoning, faster responses"medium"– Balanced reasoning (default)"high"– Deep reasoning for complex tasks
Manual Extended Thinking (Deprecated on Opus 4.7)
Manual mode lets you set a fixed budget_tokens value. This is still functional on Claude Opus 4.6 and Sonnet 4.6, but it's deprecated and will be removed in future releases.
Model Support Summary
| Model | Adaptive Thinking | Manual Mode | Notes |
|---|---|---|---|
| Claude Opus 4.7 | ✅ Required | ❌ Returns 400 error | Use thinking: {type: "adaptive"} with effort |
| Claude Opus 4.6 | ✅ Recommended | ✅ Deprecated but works | Manual mode still functional |
| Claude Sonnet 4.6 | ✅ Recommended | ✅ Deprecated but works | Interleaved mode deprecated |
| Claude Mythos Preview | ✅ Default | ✅ Accepted | thinking: {type: "disabled"} not supported; display defaults to "omitted" |
How to Use Extended Thinking in the API
Using Adaptive Thinking (Claude Opus 4.7)
Here's how to enable adaptive thinking 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"
},
messages=[
{
"role": "user",
"content": "Are there an infinite number of prime numbers such that n mod 4 == 3?"
}
]
)
for block in response.content:
if block.type == "thinking":
print(f"\nThinking: {block.thinking}")
elif block.type == "text":
print(f"\nFinal answer: {block.text}")
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: '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(\nThinking: ${block.thinking});
} else if (block.type === 'text') {
console.log(\nFinal answer: ${block.text});
}
}
Using Manual Extended Thinking (Opus 4.6 / Sonnet 4.6)
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": "Design a distributed caching system that handles cache invalidation across 50 nodes."
}
]
)
for block in response.content:
if block.type == "thinking":
print(f"\nThinking: {block.thinking}")
elif block.type == "text":
print(f"\nFinal answer: {block.text}")
Controlling Thinking Display
You can control how much of Claude's thinking is visible in the response using the display parameter:
"visible"(default) – Full thinking content is returned"summarized"– A summary of the thinking is returned instead of the full content"omitted"– No thinking content is returned; only the final text response
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={
"type": "adaptive",
"effort": "high",
"display": "summarized"
},
messages=[
{
"role": "user",
"content": "Explain the P vs NP problem in simple terms."
}
]
)
Best Practices
1. Set Appropriate Max Tokens
Extended thinking consumes tokens from your max_tokens budget. If you set budget_tokens to 10,000, ensure max_tokens is at least 12,000–16,000 to leave room for the final response.
2. Use Adaptive Thinking for Opus 4.7
Manual mode is completely blocked on Claude Opus 4.7. Always use thinking: {type: "adaptive"} with the effort parameter for this model.
3. Choose Effort Based on Task Complexity
- Low effort: Simple Q&A, factual lookups
- Medium effort: Standard analysis, moderate reasoning
- High effort: Complex math, multi-step logic, code generation
4. Handle Thinking Blocks in Streaming
When streaming, thinking blocks appear as separate events. Make sure your streaming handler can process both thinking and text delta events.
5. Verify Signatures for Sensitive Applications
The signature field in thinking blocks can be used to verify the integrity of the thinking content, especially important for auditing or compliance use cases.
Common Pitfalls
- Forgetting to increase
max_tokens: If your budget is 10,000 and max_tokens is 8,000, the request will fail. - Using manual mode on Opus 4.7: Returns a 400 error. Switch to adaptive thinking.
- Ignoring thinking blocks: Your application must handle
thinkingcontent blocks in the response, or they will be silently dropped.
Conclusion
Extended thinking transforms Claude from a black-box answer generator into a transparent reasoning partner. By adopting adaptive thinking with the effort parameter, you get the right amount of reasoning for each task without manual tuning. For legacy models, manual mode still works but plan to migrate to adaptive thinking as Anthropic phases out the old API.
Key Takeaways
- Adaptive thinking is the future: Use
thinking: {type: "adaptive"}witheffortfor Claude Opus 4.7 and newer models. Manual mode is deprecated. - Control transparency with
display: Choose between"visible","summarized", or"omitted"to balance insight with response size. - Match effort to task complexity: Low for simple Q&A, medium for standard reasoning, high for complex multi-step problems.
- Budget tokens carefully: Thinking consumes from your
max_tokenspool—always allocate extra tokens for the final response. - Handle thinking blocks in your code: Your application must process
thinkingcontent blocks to avoid losing the reasoning output.