Claude extended thinking: budget_tokens, adaptive thinking and effort, model by model
Claude extended thinking lets the model reason in thinking blocks before it answers. There are two ways to control it. The older manual mode sets a token budget with thinking: {type: "enabled", budget_tokens: N}; it is deprecated on Claude 4.6 models and rejected on Claude 4.7 and later. The current way is adaptive thinking, where Claude decides when and how much to think, steered by the effort parameter. On the Claude 5 family it is on by default. Either way, thinking tokens are billed as output tokens and count toward max_tokens.
What extended thinking is
Without thinking, a model answers in one pass. With thinking on, Claude "works through the problem in its own words before answering": it restates the question, tries approaches, checks intermediate results and drops paths that don't hold up. That work arrives in thinking content blocks ahead of the text blocks of the answer. The docs name the tasks where it helps: "math, coding, analysis, and long-running agentic work".
The cost is real: "the tokens Claude spends reasoning are billed as output tokens, even when the thinking text isn't returned to you, and they count toward max_tokens".
Which mode your model uses
"Extended thinking" now names the older, manual mode. Which one you use depends on the model:
| Model | Thinking by default | How you control it |
|---|---|---|
| Claude Opus 5.5, Fable 5.1, Fable 5, Opus 5, Sonnet 5.5, Sonnet 5, Haiku 5.5 | On (adaptive) | output_config.effort |
| Claude Opus 4.8, Opus 4.7 | Off | thinking: {type: "adaptive"} + effort; budget_tokens returns a 400 |
| Claude Opus 4.6, Sonnet 4.6 | Off | Adaptive recommended; budget_tokens still works but is deprecated |
| Claude Opus 4.5, Haiku 4.5, Sonnet 4.5 and earlier | Off | budget_tokens only; adaptive returns a 400 |
Turning thinking off also depends on the model. Claude Opus 5.5 and Fable 5.1 reject {type: "disabled"}, so thinking can't be turned off there. Claude Haiku 5.5 and Opus 5 accept it at high effort or below. On Claude Sonnet 5.5 the lowest setting is {type: "between_tools"}, which turns off the thinking before the first answer.
Manual extended thinking: budget_tokens
On models that support it, add a thinking object with a token budget:
python
response = client.messages.create(
model="claude-opus-4-5",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[{"role": "user", "content": "Find the bug in this function: ..."}],
)
The budget rules:
- At least 1,024 tokens. The API rejects smaller values.
- Below
max_tokens, because thinking counts toward it. The exception is interleaved thinking with tools, where the budget spans the whole assistant turn. - A target, not a cap. Claude may stop well before the budget;
max_tokensstays the hard ceiling. - Tuning: start near 1,024 for simple tasks and at 16,000 or more for complex ones. Above 32,000, the docs advise the Message Batches API, because very long requests can hit timeouts.
Adaptive thinking and effort
Adaptive thinking lets Claude decide on each request whether to think and how much. You steer it with effort, not with a token count:
json
{
"model": "claude-sonnet-4-6",
"max_tokens": 16000,
"thinking": {"type": "adaptive"},
"output_config": {"effort": "high"}
}
That is also the whole migration from budget_tokens: remove the budget, set type to adaptive, and move the depth control to output_config.effort.
| Effort | What it's for |
|---|---|
low |
Simple, fast, high-volume work, such as subagents |
medium |
A balance of speed, cost and quality; the default on Claude Opus 5.5 and Haiku 5.5 |
high |
Complex reasoning and agentic tasks; the default on the other models that support effort |
xhigh |
Long-running coding and agentic tasks |
max |
The deepest reasoning, with no limit on token spending |
Not every model offers every level. Two things change compared with a fixed budget. First, effort "is a behavioral signal, not a strict token budget", and it shapes every output token, including text and tool calls, not only thinking. Second, at lower effort Claude "may skip thinking entirely on easy inputs". Set effort explicitly and test the level on your own cases; Anthropic's advice for each model differs.
Reading thinking blocks
Each thinking block carries a signature, an encrypted copy of the full thinking. What the thinking text field contains depends on display:
summarized: a readable summary of the reasoning. The default on Claude 4.6 models and earlier.omitted: an empty text field; only the signature comes back. The default on the Claude 5 family, and faster to stream.
You never get the raw chain of thought, and you pay for the full thinking, not the summary. To see how much thinking you paid for, read usage.output_tokens_details.thinking_tokens.
Thinking with tools
Thinking changes the tool use loop in three ways:
- Pass thinking blocks back unchanged. When you return a
tool_result, include the assistant's thinking blocks "complete and unmodified". The API decides which old blocks Claude actually sees, so you don't prune them yourself. - Claude can think between tool calls. With adaptive thinking this interleaved thinking is automatic: Claude reasons about each tool result before its next step. In manual mode, older models need a beta header, and Claude Opus 4.6 has no interleaved thinking in manual mode at all.
- Forcing a tool skips the thinking. In manual mode, only
tool_choiceautoornoneworks. With adaptive thinking, a forced tool call starts the response with the call and no thinking block, and Claude Opus 5.5, Sonnet 5.5 and Fable 5.1 reject forced tool use. To let Claude think first, useautoand say in the prompt when to call the tool.
A turn runs in one thinking mode from start to end, so don't switch thinking on or off in the middle of an agentic loop.
Cost, caching and the context window
- Cost: thinking is output. Lower effort, or a smaller budget, is the main cost lever; see Claude API pricing.
- Caching: changing
budget_tokensor the top-level effort between requests invalidates cached prompt prefixes. Pick one value for a cached conversation and keep it. - Context: on the Claude 5 family and recent Opus and Sonnet models, earlier turns' thinking blocks stay in context and count as input. Long conversations fill the context window faster.
- Sampling: on Claude 4.7 and later, a non-default
temperature,top_portop_kreturns a 400 on every request. On older models,temperatureandtop_kcan't be combined with thinking.
Thinking on the Claude Certified Architect exam
Thinking settings belong to the developer exam's ground more than the architect's. The CCAR-F guide mentions extended thinking once, in task 4.6 (multi-pass review). There, an independent review instance, one without the generator's reasoning context, catches subtle issues better than self-review instructions or extended thinking. More thinking in the same session doesn't replace a second pair of eyes.
More in all articles.
Sources: Thinking, Extended thinking and Effort, all read on 21 October 2026; Claude Certified Architect Foundations exam guide v1.0, task statement 4.6.
FAQ
How do I enable extended thinking in the Claude API?
On Claude 4.5 and earlier, send thinking: {type: "enabled", budget_tokens: N} with a budget of at least 1,024 tokens and below max_tokens. On Claude 4.6, 4.7 and 4.8 models, send thinking: {type: "adaptive"}. On the Claude 5 family, adaptive thinking is already on; set output_config.effort to control how much Claude thinks.
Why does budget_tokens return a 400 error?
Claude 4.7 and later models don't support manual extended thinking. Remove budget_tokens, send thinking: {type: "adaptive"} or omit thinking where it is on by default, and set output_config.effort instead.
Do I pay for thinking tokens?
Yes. Thinking tokens are billed as output tokens even when the thinking text isn't returned, and you pay for the full thinking, not the shorter summary you see. usage.output_tokens_details.thinking_tokens shows how many.
Can I see Claude's raw chain of thought?
No. Thinking blocks contain a summary of Claude's reasoning, or nothing at all when display is omitted, which is the default on the Claude 5 family. No display setting returns the raw chain of thought.