Mastering Claude's Extended Thinking: A Practical Guide to Adaptive and Manual Reasoning
Learn how to use Claude's extended thinking for complex tasks. Covers adaptive thinking with effort parameter, manual mode, API examples, and best practices for Claude Opus and Sonnet models.
This guide teaches you how to enable and configure Claude's extended thinking for step-by-step reasoning. You'll learn about adaptive thinking (recommended for Opus 4.7+) and manual mode, with code examples and model-specific differences.
Mastering Claude's Extended Thinking: A Practical Guide to Adaptive and Manual Reasoning
Claude's extended thinking feature unlocks enhanced reasoning capabilities for complex tasks—from multi-step math problems to intricate code analysis. Instead of jumping straight to an answer, Claude generates a transparent, step-by-step thought process before delivering its final response. This guide covers everything you need to know: how extended thinking works, which models support it, how to configure it via the API, and best practices for getting the most out of it.
What Is Extended Thinking?
Extended thinking gives Claude the ability to "think out loud" before answering. When enabled, the API response includes special thinking content blocks that contain Claude's internal reasoning, followed by the final text response. This provides:
- Enhanced accuracy on complex reasoning tasks
- Transparency into how Claude arrives at its conclusions
- Debugging insights when outputs are unexpected
- Auditability for regulated or high-stakes applications
Adaptive Thinking vs. Manual Extended Thinking
There are two ways to enable extended thinking, and the right choice depends on your Claude model.
Adaptive Thinking (Recommended for Claude Opus 4.7+)
Adaptive thinking lets Claude decide how much reasoning effort to apply based on the task. You control the effort level rather than setting a fixed token budget. This is the only supported mode for Claude Opus 4.7 and later models.
Key parameter:effort (values: "low", "medium", "high")
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={
"type": "adaptive",
"effort": "high" # Controls reasoning depth
},
messages=[
{"role": "user", "content": "Solve this complex differential equation: y'' - 3y' + 2y = e^x"}
]
)
Access thinking blocks
for block in response.content:
if block.type == "thinking":
print("Thinking:", block.thinking)
elif block.type == "text":
print("Answer:", block.text)
Manual Extended Thinking (Deprecated on Opus 4.7+)
Manual mode lets you set a fixed token budget for thinking. This is still functional on Claude Opus 4.6 and Claude Sonnet 4.6 but is deprecated and will be removed in future model releases.
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=16000,
thinking={
"type": "enabled",
"budget_tokens": 8000 # Fixed thinking budget
},
messages=[
{"role": "user", "content": "Explain quantum entanglement in simple terms."}
]
)
Model-Specific Behavior
Not all Claude models handle extended thinking the same way. Here's a quick reference:
| Model | Adaptive Thinking | Manual Thinking | Notes |
|---|---|---|---|
| Claude Opus 4.7+ | ✅ Required | ❌ Returns 400 error | Use effort parameter |
| Claude Opus 4.6 | ✅ Recommended | ✅ Deprecated but works | Migrate to adaptive |
| Claude Sonnet 4.6 | ✅ Recommended | ✅ Deprecated (interleaved mode) | Migrate to adaptive |
| Claude Mythos Preview | ✅ Default | ✅ Accepted | disabled not supported; use display: "summarized" for summaries |
Special Case: Claude Mythos Preview
Mythos Preview has adaptive thinking enabled by default. You cannot disable thinking entirely. If you want summarized thinking (rather than full reasoning), pass:
response = client.messages.create(
model="claude-mythos-preview",
max_tokens=16000,
thinking={
"type": "adaptive",
"effort": "medium",
"display": "summarized" # Returns summaries instead of full thinking
},
messages=[
{"role": "user", "content": "Analyze the pros and cons of nuclear fusion."}
]
)
Understanding the Response Format
When extended thinking is enabled, the API response contains an array of content blocks. Here's the default structure:
{
"content": [
{
"type": "thinking",
"thinking": "Let me analyze this step by step...",
"signature": "WaUjzkypQ2mUEVM36O2TxuC06KN8xyfbJwyem2dw3URve/op91XWHOEBLLqIOMfFG/UvLEczmEsUjavL...."
},
{
"type": "text",
"text": "Based on my analysis..."
}
]
}
Important fields:
thinking: The raw reasoning textsignature: A cryptographic signature verifying the thinking block's integrity (useful for auditing)text: The final answer
Practical Use Cases
1. Complex Math and Science Problems
Extended thinking shines when Claude needs to work through multi-step calculations or scientific reasoning.
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=32000,
thinking={"type": "adaptive", "effort": "high"},
messages=[
{"role": "user", "content": "A ball is thrown upward with initial velocity 20 m/s from a height of 1.5 m. When does it hit the ground?"}
]
)
2. Code Debugging and Refactoring
Use extended thinking to have Claude reason through bugs or architectural decisions.
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=16000,
thinking={"type": "adaptive", "effort": "medium"},
messages=[
{"role": "user", "content": "Here's a Python function that's supposed to find prime numbers but has a bug. Can you fix it?\n\ndef find_primes(n):\n primes = []\n for num in range(2, n):\n for i in range(2, num):\n if num % i == 0:\n break\n else:\n primes.append(num)\n return primes"}
]
)
3. Multi-Step Reasoning Tasks
For tasks requiring logical deduction, like puzzle solving or decision trees.
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={"type": "adaptive", "effort": "high"},
messages=[
{"role": "user", "content": "Three friends—Alice, Bob, and Carol—each have a different favorite color: red, blue, or green. Alice does not like red. Bob's favorite color is not blue. Carol's favorite color is green. What is each person's favorite color?"}
]
)
Best Practices
- Start with adaptive thinking – It's the future-proof choice and works across all modern Claude models. Use
effort: "medium"as a starting point.
- Adjust effort based on task complexity – Use
"low"for simple reasoning,"medium"for typical tasks, and"high"for complex multi-step problems.
- Set
max_tokensgenerously – Extended thinking consumes tokens from yourmax_tokensbudget. Ensure you allocate enough for both thinking and the final answer. A good rule of thumb: setmax_tokensto at least 2x your expected thinking budget.
- Handle thinking blocks in your application – If you're building a UI, consider displaying thinking blocks in a collapsible section or streaming them for a more interactive experience.
- Audit with signatures – The
signaturefield in thinking blocks allows you to verify the integrity of Claude's reasoning. Store these if you need to prove what was thought.
- Migrate away from manual mode – If you're using
type: "enabled"withbudget_tokens, plan to switch to adaptive thinking. Manual mode is deprecated on Opus 4.6 and Sonnet 4.6, and returns errors on Opus 4.7+.
Troubleshooting Common Issues
- 400 error on Opus 4.7+: You're using manual thinking (
type: "enabled"). Switch totype: "adaptive"with theeffortparameter. - Thinking blocks are empty: Ensure you're not passing
thinking: {"type": "disabled"}. On Mythos Preview, thinking cannot be disabled. - Response too long: Reduce
max_tokensor lower theeffortlevel. - Thinking not appearing in output: Check that you're iterating over
response.contentand handlingtype: "thinking"blocks.
Key Takeaways
- Extended thinking provides step-by-step reasoning from Claude, improving accuracy on complex tasks and offering transparency into its decision-making.
- Adaptive thinking (with the
effortparameter) is the recommended approach for Claude Opus 4.7+ and is future-proof. Manual thinking withbudget_tokensis deprecated on older models. - Model behavior varies: Opus 4.7+ requires adaptive thinking; Mythos Preview has it enabled by default; Opus 4.6 and Sonnet 4.6 support both but recommend adaptive.
- Always allocate sufficient
max_tokensto cover both thinking and the final answer—typically 2x your expected thinking budget. - Use the
signaturefield for auditing and integrity verification of Claude's reasoning process.