Extended Thinking for Hard Problems
Harry
· 15 Oct 2026
· 3 views
Log in to track your progress and mark lessons complete.
Sponsored
When to Use It
Architecture decisions, tricky debugging, math-heavy tasks and anything where the first answer is usually wrong. Extended thinking buys reasoning effort where it pays off.
Practical Setup
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[{"role": "user", "content": problem}]
)Tips
Set the thinking budget to roughly half of max tokens. Ask Claude to show alternatives it considered, not just the winner. For routine tasks leave thinking off: it costs time and money per token.