Mastering Extended Thinking in Claude: A Complete Guide to Adaptive and Manual Thinking Modes
Learn how to enable and optimize Claude's extended thinking capabilities for complex reasoning tasks, including adaptive thinking, effort parameters, and token budgets across all supported models.
This guide explains how to use Claude's extended thinking feature to enhance reasoning on complex tasks. You'll learn the difference between adaptive thinking (recommended for Opus 4.7+) and manual mode, how to set effort parameters and token budgets, and get practical API code examples for Python and TypeScript.
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 enhanced accuracy and transparency into Claude's internal thought process.
This guide covers everything you need to know: from the latest adaptive thinking mode on Claude Opus 4.7 and later models, to the deprecated manual mode still available on older models, and how to choose the right configuration for your use case.
How Extended Thinking Works
When extended thinking is enabled, Claude generates special thinking content blocks in the API response. These blocks contain the model's internal reasoning—its chain-of-thought—before it produces the final text content block. The response also includes a cryptographic signature for verification.
Here's a simplified example of what the 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..."
}
]
}
The thinking blocks are not shown to end users by default, but you can choose to display them (e.g., in a developer tool or debugging interface) or summarize them using the display parameter.
Adaptive Thinking (Recommended for Opus 4.7+)
For Claude Opus 4.7 and later models, Anthropic has introduced adaptive thinking. Instead of setting a fixed token budget, you let Claude dynamically decide how much thinking is needed based on the complexity of the task. This is more efficient and often yields better results.
Using the Effort Parameter
With adaptive thinking, you control the level of reasoning via the effort parameter. The effort can be set to low, medium, or high. Higher effort means Claude will spend more tokens on reasoning, which is useful for very complex tasks.
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=8192,
thinking={
"type": "adaptive",
"effort": "high" # Options: low, medium, high
},
messages=[
{"role": "user", "content": "Analyze the economic impact of climate change on global agriculture over the next 50 years. Consider multiple scenarios."}
]
)
Access thinking blocks
for block in response.content:
if block.type == "thinking":
print("Thinking:", block.thinking)
elif block.type == "text":
print("Final answer:", block.text)
TypeScript Example:
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: 8192,
thinking: {
type: 'adaptive',
effort: 'high'
},
messages: [
{ role: 'user', content: 'Analyze the economic impact of climate change on global agriculture over the next 50 years. Consider multiple scenarios.' }
]
});
for (const block of response.content) {
if (block.type === 'thinking') {
console.log('Thinking:', block.thinking);
} else if (block.type === 'text') {
console.log('Final answer:', block.text);
}
}
}
main();
Task Budgets (Beta)
For even finer control, you can combine adaptive thinking with a task budget. This sets a maximum token limit for the entire thinking process, preventing runaway token usage while still allowing adaptive allocation within that budget.
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=8192,
thinking={
"type": "adaptive",
"effort": "high",
"task_budget_tokens": 4000 # Optional: cap the thinking tokens
},
messages=[
{"role": "user", "content": "Solve this complex math problem..."}
]
)
Fast Mode (Research Preview)
Fast mode is an experimental feature that reduces thinking time at the cost of some reasoning depth. It's useful for latency-sensitive applications where you still want some extended reasoning but can't wait for full-depth thinking.
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=8192,
thinking={
"type": "adaptive",
"effort": "medium",
"fast_mode": True # Research preview
},
messages=[
{"role": "user", "content": "Summarize this 50-page document..."}
]
)
Manual Extended Thinking (Deprecated but Still Available)
On older models like Claude Opus 4.6 and Claude Sonnet 4.6, you can still use the manual mode by setting type: "enabled" and providing a budget_tokens value. This tells Claude exactly how many tokens it can use for thinking.
Important: Manual mode is deprecated on these models and will be removed in a future release. You should migrate to adaptive thinking as soon as possible.Python Example (Manual Mode):
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=8192,
thinking={
"type": "enabled",
"budget_tokens": 4000 # Fixed token budget for thinking
},
messages=[
{"role": "user", "content": "Explain the theory of relativity in simple terms."}
]
)
Model-Specific Behavior
Different Claude models handle extended thinking differently. Here's a quick reference:
| Model | Adaptive Thinking | Manual Mode | Notes |
|---|---|---|---|
| Claude Opus 4.7+ | ✅ Recommended | ❌ Returns 400 error | Use effort parameter |
| Claude Opus 4.6 | ✅ Recommended | ⚠️ Deprecated | Migrate soon |
| Claude Sonnet 4.6 | ✅ Recommended | ⚠️ Deprecated | Interleaved mode deprecated |
| Claude Mythos Preview | ✅ Default | ✅ Accepted | display defaults to "omitted" |
Claude Mythos Preview Special Behavior
For Claude Mythos Preview, adaptive thinking is the default. If you pass thinking: {type: "enabled", budget_tokens: N}, it will be accepted. However, thinking: {type: "disabled"} is not supported. To receive thinking summaries, pass display: "summarized".
response = client.messages.create(
model="claude-mythos-preview",
max_tokens=8192,
thinking={
"type": "adaptive",
"display": "summarized" # Get summaries instead of full thinking
},
messages=[
{"role": "user", "content": "What are the implications of quantum computing for cryptography?"}
]
)
Best Practices
- Use adaptive thinking for new projects. It's simpler, more efficient, and future-proof. Manual mode is on its way out.
- Start with
effort: "medium"and adjust up or down based on task complexity. High effort is great for deep analysis but consumes more tokens. - Set a task budget if you're concerned about token costs. This gives you a safety net while still allowing adaptive allocation.
- Consider fast mode for real-time applications where speed matters more than depth.
- Handle thinking blocks in your UI if you want to show users Claude's reasoning. You can display the full thinking or a summarized version.
- Always check the model's capabilities before coding. Refer to the table above to avoid 400 errors.
Key Takeaways
- Adaptive thinking (
type: "adaptive") is the recommended approach for Claude Opus 4.7 and later models, using theeffortparameter to control reasoning depth. - Manual mode (
type: "enabled"withbudget_tokens) is deprecated on Opus 4.6 and Sonnet 4.6, and returns a 400 error on Opus 4.7+. - Task budgets and fast mode give you additional control over token usage and latency.
- Claude Mythos Preview defaults to adaptive thinking and requires
display: "summarized"to receive thinking summaries. - Always migrate existing manual mode implementations to adaptive thinking to avoid future breakage.