The most common mistake I see with extended thinking is flipping it on for the entire application, watching the bill climb, and concluding that reasoning models are overpriced. The model is not overpriced. You are paying a premium on every request when only a fraction of them have the shape that benefits from it. Extended thinking is a scalpel. Most teams are using it as a coat of paint.

There is a sharper way to think about this than “use it for hard problems.” The real question is whether your task has a chain of logical dependencies where step four depends on getting step two exactly right. That property, not raw difficulty, is what thinking tokens buy you. This post maps the task types that clear that bar, the ones that fail it, and how to set the budget per class with the latency and cost numbers that actually drive the decision.

The Naive Setup and Why It Breaks

Here is what almost everyone ships first. One client, thinking enabled globally, a comfortable budget so nothing gets truncated.

import anthropic

client = anthropic.Anthropic()

def ask(prompt: str) -> str:
    response = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=8000,
        thinking={"type": "enabled", "budget_tokens": 10000},
        messages=[{"role": "user", "content": prompt}],
    )
    return "".join(b.text for b in response.content if b.type == "text")

This works. Every answer is at least as correct as before, often slightly better on the hard ones. So it looks like a free upgrade. It is not, and the cost shows up in two places that are easy to miss until you are in production.

The first is latency. Thinking tokens are generated sequentially before the first visible answer token appears. On a request where the model burns 6,000 thinking tokens, your user stares at a spinner for the entire time it takes to generate those 6,000 tokens, and only then does the answer start streaming. For a chat UI this turns a 1.2 second response into an 8 second one. Nobody enabled thinking to make their product feel slower, but that is the default outcome when you apply it to simple turns.

The second is the quality regression on the easy cases. On a task like “rewrite this paragraph to be friendlier,” the model with a thinking budget will deliberate about tone, audience, and three alternatives it then discards, and the answer that comes out is often stiffer and more mechanical than the direct one. More deliberation is not more quality when there is nothing to deliberate about.

So the naive setup pays for latency and sometimes buys worse answers. Both problems come from the same root cause: the budget is applied uniformly to a workload that is not uniform.

What Thinking Tokens Actually Buy

Extended thinking generates an internal chain of thought before the answer. Those thinking tokens are billed as output tokens and can run far longer than the final response. The mechanism that makes them valuable is self-correction: the model reads everything it has written in the thinking block so far, so it can notice “this assumed the list was sorted, but the input says it is not” at thinking-token 900 and recover, instead of committing to the wrong path the way a single-pass generation would.

That recovery only has value when the task has internal dependencies. If getting the final answer requires a sequence of steps where an early mistake silently corrupts everything downstream, the scratchpad lets the model catch the mistake before it reaches you. If the task is a lookup, a transformation, or a single judgment call, there is no downstream to corrupt, so the scratchpad is overhead.

This gives a cleaner test than “is it hard.” Ask: does this task have multi-step logical dependencies where an error in an early step is not locally obvious? That is the property. Call it dependency depth.

Low dependency depth (thinking wasted):
  input --> single transformation --> answer
  "Translate this." "Classify this ticket." "What port does Postgres use?"
  An error is visible immediately. Nothing downstream to protect.

High dependency depth (thinking earns its cost):
  input --> step1 --> step2 --> step3 --> ... --> answer
                 \________ error here silently poisons everything after

  "Prove this invariant holds." "Why does this deadlock only under load?"
  "Plan a migration that preserves these four constraints."

The Task Type Map

Difficulty and dependency depth are different axes, and it is dependency depth that predicts payoff. A gnarly piece of creative writing is hard but has no verifiable dependency chain, so thinking does nothing for it. A medium logic puzzle is not hard but has real dependencies, so thinking helps a lot.

Task typeDependency depthThinking budgetWhy
Math proofs, competition mathHighHigh (12-16k)Every step builds on the last, errors compound
Complex debugging (why does X fail under Y)HighHigh (10-16k)Must hold many facts and trace causality
Multi-constraint planning / schedulingHighMedium-high (8-12k)Constraints interact, greedy choices backfire
Hard algorithm design with edge casesHighMedium-high (8-12k)Correctness depends on covering all cases
Nested SQL, query optimizationMediumMedium (4-6k)Some dependency, bounded search space
Multi-hop reasoning over a documentMediumMedium (4-6k)Chain of lookups, but each is checkable
Code generation (CRUD, boilerplate, glue)LowOffFirst reasonable answer is usually right
Simple Q&A, factual lookupLowOffRetrieval, not reasoning
Classification, extraction, taggingLowOffSingle judgment, no chain
Summarization, rewriting, tone editsLowOffOver-deliberation hurts fluency
Creative writingLow (no verifier)OffNo correct answer to converge toward

The two rows that surprise people are code generation and creative writing, because both feel like they should benefit. Code generation usually does not, because for the bulk of real code the first reasonable structure a strong model produces is correct, and the failure mode is not a broken reasoning chain but a missing requirement, which thinking does not fix. The exception is genuinely algorithmic code with subtle correctness conditions, which is why “hard algorithm design” sits in a different row. Creative writing has no verifier, so the self-correction loop has no signal to correct against and tends to sand the life out of the prose.

The Latency Tradeoff, Concretely

Cost per request gets all the attention, but latency is usually the thing that actually constrains your design, because it is what the user feels. Thinking tokens are pure time-to-first-token. The answer cannot begin until the thinking block closes.

Rough numbers for a Sonnet-class model, assuming a generation rate around 60 to 90 tokens per second:

ConfigThinking tokensTime to first answer tokenFelt latency
No thinking0~0.4sInstant
Budget 4k (typical use ~2.5k)~2,500~3 to 4sNoticeable pause
Budget 10k (typical use ~6k)~6,000~7 to 9sLong, needs a spinner
Budget 16k (typical use ~11k)~11,000~13 to 18sBackground job territory

The point is not the exact seconds, which move with model and load. The point is the shape: thinking cost is paid up front, before anything appears, and it scales with the tokens the model actually consumes, not the budget ceiling. A high budget on a request that only needs 2k thinking tokens does not cost you the full ceiling in latency, which is why setting a generous ceiling and letting the model use what it needs is the right default for the high-dependency rows.

This reshapes where thinking belongs. An interactive chat turn cannot absorb a 9 second pre-answer pause, so for chat you either keep budgets low or stream a visible “thinking” indicator. A nightly batch that debugs failed test cases has all the latency budget in the world, so there you push the ceiling up and let it run.

Budget: High vs Low Is Its Own Decision

Turning thinking on is the first decision. How much to give it is the second, and it is not the same as “more is better.” Two failure modes bracket the useful range.

Set the budget too low and you get the worst outcome of all. If the model hits the ceiling mid-reasoning, it is forced to produce a final answer from an incomplete chain of thought, which is frequently worse than a plain single-pass answer, because the model has committed to a partial analysis and then had to guess the conclusion. A truncated proof is less reliable than no proof attempt. So the rule is: if a task clears the dependency-depth bar, give it enough room to actually finish, or do not enable thinking at all. There is no useful middle where you starve it.

Set the budget absurdly high and you mostly waste latency headroom, not money, because billing follows actual consumption. The real cost of an oversized ceiling is that you lose the ability to cap tail latency, and that occasional requests wander far longer than they needed to.

The practical loop is to log actual thinking tokens consumed per task class and tune from data.

BUDGETS = {
    "proof":        16000,   # high dependency, latency tolerant
    "debug":        12000,   # high dependency
    "planning":      8000,   # medium-high
    "sql":           5000,   # medium
    "default_think": 6000,
}

def budget_for(task_class: str) -> int:
    return BUDGETS.get(task_class, BUDGETS["default_think"])

If a class consistently uses under 30 percent of its budget, it probably does not belong in the thinking path at all; the dependency depth you assumed is not there. If a class routinely pins the ceiling, raise it, because you are truncating reasoning and eating the worst-case quality hit. The consumed-token distribution per class is the only honest signal; benchmark numbers from someone else’s workload do not transfer to yours.

A Router That Makes the Decision

The clean architecture is a cheap classifier in front that assigns each request to a task class, and the class determines both whether thinking is on and how large the budget is. Keyword heuristics are fine to start; a Haiku-class classifier is more accurate once you have traffic.

import anthropic

client = anthropic.Anthropic()

# task_class -> (thinking_on, budget_tokens)
ROUTING = {
    "proof":          (True, 16000),
    "debug":          (True, 12000),
    "planning":       (True,  8000),
    "sql":            (True,  5000),
    "codegen":        (False,     0),
    "qa":             (False,     0),
    "classify":       (False,     0),
    "rewrite":        (False,     0),
    "creative":       (False,     0),
}

def classify(prompt: str) -> str:
    p = prompt.lower()
    if any(s in p for s in ("prove", "show that", "is it correct that")):
        return "proof"
    if any(s in p for s in ("why does", "deadlock", "race condition", "only fails")):
        return "debug"
    if any(s in p for s in ("schedule", "plan a migration", "subject to", "constraint")):
        return "planning"
    if "select " in p or "query plan" in p:
        return "sql"
    if any(s in p for s in ("summarize", "rewrite", "translate", "friendlier")):
        return "rewrite"
    if any(s in p for s in ("classify", "label", "extract", "tag")):
        return "classify"
    return "codegen"  # safe default: no thinking

def answer(prompt: str) -> dict:
    task_class = classify(prompt)
    think_on, budget = ROUTING[task_class]

    kwargs = {
        "model": "claude-sonnet-4-6",
        "max_tokens": 8000,
        "messages": [{"role": "user", "content": prompt}],
    }
    if think_on:
        kwargs["thinking"] = {"type": "enabled", "budget_tokens": budget}

    resp = client.messages.create(**kwargs)
    text = "".join(b.text for b in resp.content if b.type == "text")
    thinking_used = sum(
        len(b.thinking) for b in resp.content if b.type == "thinking"
    )
    return {
        "class": task_class,
        "answer": text,
        "thinking_budget": budget if think_on else 0,
        "output_tokens": resp.usage.output_tokens,
    }

The default branch matters: when the classifier is unsure, it should land on no thinking. The cost of missing a hard problem is one slightly worse answer that you can retry with thinking forced on. The cost of defaulting everything to thinking is the naive setup you were trying to escape, applied to your whole tail of ambiguous requests.

Streaming Changes the Equation for Chat

If you are stuck with a high-dependency task inside an interactive surface, do not hide the thinking behind a dead spinner. Claude streams thinking blocks, and showing a condensed “working through the constraints…” state converts the latency from a stall into visible progress. The seconds are the same; the perceived wait is much shorter, and users tolerate a 9 second reasoned answer far better when they can see it is doing something. This is a product decision that often matters more than shaving thinking tokens.

Honest Assessment

What works. Gated extended thinking, where only high-dependency task classes get it and each gets a budget sized to actually finish, gives you the real quality lift on proofs, hard debugging, and constrained planning without dragging down the latency of everything else. The dependency-depth test is a better predictor than difficulty and it is easy to apply by hand while building a router.

What does not. Global thinking is a quiet tax on latency and a sometimes-tax on quality, and it is the single most common way teams waste money here. Starving a thinking task with a budget too small to finish is worse than not thinking at all, because a truncated reasoning chain underperforms a clean single pass. And treating thinking as a general quality knob for code generation or creative writing just makes answers slower and stiffer.

What to actually do. Default to thinking off. Turn it on only for task classes that clear the dependency-depth bar, and for those, set a generous ceiling and let actual consumption tell you where it really lands. Log thinking tokens per class and retune monthly. For interactive surfaces, either keep budgets low or stream the thinking state so the latency reads as progress. The teams getting value from extended thinking are not the ones who turned it on everywhere. They are the ones who turned it on in four places and left it off in forty.