Feature Deep-Dive

Solve Hard Problems Correctly with Extended Thinking

Deep reasoning mode — for when the answer actually matters

Extended Thinking gives Claude a reasoning budget — a scratchpad to think through a problem step by step before producing a final answer. On hard math, complex code, and multi-variable decisions, it dramatically improves accuracy. On simple tasks, it adds latency with no benefit.

Claude extended thinking (also called chain-of-thought reasoning) lets Claude work through complex problems step by step before giving a final answer. When enabled, Claude shows its reasoning process, leading to more accurate results on math, logic, code analysis, and multi-step planning tasks.

How It Works

The mechanics of Extended Thinking

A token budget for reasoning

When you enable Extended Thinking via the API (or in Claude.ai for supported plans), you allocate a "thinking budget" in tokens. Claude uses this budget to reason through the problem in a hidden scratchpad before writing its final response. The reasoning process is visible in the API response under a thinking block.

Chain-of-thought at scale

Extended Thinking is a production-grade implementation of chain-of-thought prompting. Instead of you adding "think step by step" to your prompt, Claude has an internal reasoning loop with a defined token budget. This matters because Claude can reconsider and backtrack within its thinking — something you can't easily replicate with prompt engineering alone.

API usage
import anthropic

client = anthropic.Anthropic()

response = client.messages.create(
    model="claude-opus-4-5",
    max_tokens=16000,
    thinking={
        "type": "enabled",
        "budget_tokens": 10000  # reasoning budget
    },
    messages=[{
        "role": "user",
        "content": "Prove that sqrt(2) is irrational."
    }]
)

# Access the thinking block
for block in response.content:
    if block.type == "thinking":
        print("Reasoning:", block.thinking)
    elif block.type == "text":
        print("Answer:", block.text)

Decision Guide

When to use Extended Thinking

Use It
Multi-step math and logic

Competition math, proofs, formal logic, and algorithmic reasoning. Extended thinking lets Claude work through each step carefully before committing to an answer.

Use It
Complex coding tasks

Architecture decisions, debugging subtle logic errors, designing data models. Extended thinking produces more considered code with fewer edge case failures.

Use It
Strategic analysis

Evaluating trade-offs, comparing options with multiple variables, synthesizing competing research findings. Thinking mode lets Claude hold more complexity simultaneously.

Skip It
Simple factual Q&A

Asking what the capital of France is, or what a function returns — standard mode is faster and cheaper. Extended thinking adds latency with no accuracy benefit on simple retrieval.

Skip It
Creative writing

For most creative tasks — drafting a blog post, brainstorming names, writing emails — standard Claude performs identically to extended thinking. The extra reasoning budget doesn't improve prose quality.

Skip It
Real-time applications

Extended thinking takes longer — sometimes significantly. If your app needs sub-2-second responses (chatbots, live search, inline suggestions), use standard mode and optimize your prompt instead.

Real Examples

Standard vs Extended: what actually changes

Solve a system of equations
Standard Mode

Claude gives an answer — often correct, sometimes with arithmetic errors on complex systems

Extended Thinking

Claude works through each substitution step, catches sign errors, and verifies the solution — dramatically higher accuracy

Preferred
Debug a subtle race condition
Standard Mode

Identifies the obvious suspects, may miss timing-dependent edge cases

Extended Thinking

Traces execution order explicitly, considers thread interleaving scenarios, produces a more complete diagnosis

Preferred
Write a marketing email
Standard Mode

Fast, high-quality output in seconds

Preferred
Extended Thinking

Same quality, much slower. Not worth the wait

Design a database schema
Standard Mode

Good schema for straightforward requirements

Extended Thinking

Considers normalization trade-offs, future query patterns, and indexing strategy more thoroughly

Preferred

Go deeper on Claude's reasoning capabilities

The prompt engineering track covers thinking modes, chain-of-thought, and advanced techniques.

Frequently Asked Questions

What is Claude extended thinking?

Extended thinking is a Claude feature that lets the model reason step-by-step before producing a final answer. It improves accuracy on complex math, logic, code analysis, and multi-step planning by making intermediate reasoning visible.

When should I use extended thinking?

Use extended thinking for complex problems where accuracy matters more than speed: mathematical proofs, code debugging, strategic analysis, and any task requiring multi-step reasoning.

Does extended thinking cost more?

Extended thinking uses more tokens because the model generates reasoning steps. The increased accuracy often reduces the need for retry prompts, so the net cost impact depends on task complexity.

How do I enable extended thinking in the Claude API?

Pass the thinking parameter with a budget_tokens value in your API request. The model will use up to that many tokens for internal reasoning before producing the final response. Set a higher budget for harder problems and a lower budget for simpler ones.

Can I see Claude's thinking steps?

In Claude.ai, thinking steps are displayed in a collapsible section above the response. In the API, the thinking content is returned as a separate content block of type "thinking" alongside the final text response. This transparency lets you verify the reasoning chain.