Claude Tips mascot
Claude Tips & Tricks
API Tips intermediate

Enable Extended Thinking for Hard Problems

Use extended thinking to let Claude reason through complex multi-step problems before responding.

When using the Claude API, enable extended thinking for problems that require deep reasoning:

response = client.messages.create(
    model="claude-opus-4-6",
    max_tokens=16000,
    thinking={
        "type": "enabled",
        "budget_tokens": 10000
    },
    messages=[{
        "role": "user",
        "content": "Analyze this distributed systems architecture..."
    }]
)

Extended thinking gives Claude a “scratchpad” to reason through problems step-by-step before producing the final answer. It makes a big difference on math, logic, code architecture, and multi-constraint problems.