# 29.2 Thinking and effort (/building-ai-workers/model-selection-and-cost/thinking-and-effort)

---
type: Document
title: "29.2 Thinking and effort"
description: "What adaptive thinking and effort cost, why effort is soft and max_tokens is hard, and how a lower effort is proved a saving on the suite."
status: stable
order: 329.02
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T10:58:07Z
chapter: '29'
part: III
expert_status: manager
concepts: [ "29.2" ]
last_verified: '2026-11-30'

sources:
  - id: anthropic-cost-and-intelligence
    title: Optimizing for cost and intelligence, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence
  - id: anthropic-thinking
    title: Building with extended thinking, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/thinking
  - id: anthropic-effort
    title: Effort, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/effort
  - id: anthropic-effort-per-message
    title: Effort per message, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/effort-per-message
  - id: anthropic-prompt-caching
    title: Prompt caching, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
  - id: anthropic-thinking-steering
    title: Steering thinking and cost, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost
generated:
  at: 2026-11-30T10:58:07Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** You ask a colleague to read a contract before you sign it. You can say "have a quick look" or "go through it carefully". That tells them how hard to work, but they still decide how long each page takes. You also hand them one sheet of paper for notes. When the sheet is full, they stop writing, even in the middle of a sentence. A careful read of a hard contract catches more. A careful read of an easy one uses up their time and finds nothing a quick look would miss. In this section, the reading is thinking, your instruction is effort, and the sheet of paper is `max_tokens`.

**What you will learn.** You practice this in Lab 29, Task 4, where both models run at the same effort and the same `max_tokens`.

- What is adaptive thinking, and what do you pay for it?
- What does effort set, and what is each model's default?
- Why is effort soft, and `max_tokens` hard?
- What do you do when an answer stops at `max_tokens`?
- Why can a change of effort cost you the cache?
- How do you know a lower effort is a saving?
- How much should a prompt say?

**Why it matters.** Thinking is paid for as output, the most expensive kind of token. Effort is the setting that moves it most. But less thinking can mean more answers stopped at a gate, so a lower bill can hide a worse worker.

**At work.** Tuesday, 10:45 a.m. Before the 11:00 batch goes out, you open the extraction's config. It names `claude-sonnet-5-5` and a `max_tokens` value, and it sets no effort. Then you count the invoices in the week's 7:10 reports that stopped at the stop-reason gate because their answer reached `max_tokens`.

<!-- OPEN: recorded run. The extraction's max_tokens value in config.json at tag ch28, and how many invoices the week's 7:10 reports stopped at the stop-reason gate for max_tokens. -->

### What is adaptive thinking, and what do you pay for it?

**With adaptive thinking, the model decides for each request whether to reason before it answers, and how much.** You met it in 21.5, where the lab set it once for a whole loop ([21.5](../agent-loop-by-hand/the-conversation-is-an-array-you-own.md)). It is the default on Claude's current models. On Opus 5.5 it cannot be turned off. On Sonnet 5.5 it cannot be turned off either, and on Haiku 5.5 it can, at `high` effort or below.[^anthropic-thinking]

Thinking tokens are billed as output tokens, and they count toward `max_tokens`. The usage shows how many in `output_tokens_details.thinking_tokens`.[^anthropic-thinking-steering] On Claude 5 models and later, the thinking text is hidden by default. You are billed for all of it either way.[^anthropic-thinking] So read the usage, not the answer. A short answer can carry a long, unseen thought.

### What does effort set, and what is each model's default?

**Effort tells the model how hard to work, from `low` to `max`.** It is set with `output_config.effort`. The levels are `low`, `medium`, `high`, `xhigh` and `max`.[^anthropic-effort] Effort affects all output tokens: the text, the tool calls and the thinking.[^anthropic-effort]

The defaults differ by model. Effort defaults to `medium` on Opus 5.5 and Haiku 5.5, and to `high` on every other model that supports it.[^anthropic-effort] "Setting effort to the model's default ... produces exactly the same behavior as omitting the effort parameter."[^anthropic-effort]

That is why the extraction's config matters at 10:45. It sets no effort, so Sonnet 5.5 runs at `high`, and a Haiku 5.5 request with no effort would run at `medium`. Section [29.3](tiers.md) shows why a comparison writes the same effort into every request. It also shows why effort is tried before a smaller model.

### Why is effort soft, and `max_tokens` hard?

**Effort is guidance the model follows. `max_tokens` is a limit the API enforces.** Anthropic's words: "Effort is a behavioral signal, not a strict token budget."[^anthropic-effort] `max_tokens` is a hard cap on all the output of one request, thinking and text together.[^anthropic-thinking-steering] In a loop of several requests, each request has its own `max_tokens`, "so it doesn't bound the whole turn's spend".[^anthropic-thinking-steering] Section 29.9 shows the limits that do.

So `max_tokens` is an upper limit that stops output from running too long. It is never a saving. Anthropic says that lowering it "does not make the model economize".[^anthropic-cost-and-intelligence] In other words, the model does not use fewer tokens. A lower cap only cuts answers off. An answer that is cut off fails the stop-reason gate, and goes to Ana.

### What do you do when an answer stops at `max_tokens`?

**Raise the cap, or lower the effort, and choose by what you see.** Anthropic gives the two remedies in one line. "If quality on those requests matters, raise the cap", and "if they were over-thought, lower the effort".[^anthropic-thinking-steering]

Chapter 25's gate already takes the first remedy once. It asks again with a higher limit, and sends a second cut answer to `needs_review` ([25.10](../prompts-and-structured-output/defensive-parsing.md)). That retry is paid for, and so is the cut answer before it. So when the 7:10 reports show many cuts, read the usage of the cut requests. Most of the tokens in thinking, on an easy invoice, point to lower effort. A long, needed answer points to a higher cap. Either change goes through the suite, because both change the output.

### Why can a change of effort cost you the cache?

**Because effort is part of what the cache matches.** Changing the effort on the request "can invalidate all or part of the prompt cache".[^anthropic-effort] Setting it to the model's default is the same as leaving it out, and does not.[^anthropic-effort]

There is a second way, in beta. A message with `role: "system"` and its own `output_config.effort` changes effort for the rest of a conversation, and "leaves the cached prefix intact". It needs the header `mid-conversation-output-config-2026-07-01`, and works on Opus 5.5, Sonnet 5.5 and Haiku 5.5, among others.[^anthropic-effort-per-message] Anthropic measured a change on the request costing 20 to 40 times a change by message.[^anthropic-cost-and-intelligence] A change to the thinking setting always breaks the cached messages.[^anthropic-prompt-caching]

Keep effort and thinking the same on both requests of an invoice, and on every invoice of a run. When you try two effort levels, run each as a run of its own, as Anthropic advises, because a change mid-run "distorts the comparison".[^anthropic-cost-and-intelligence]

### How do you know a lower effort is a saving?

**Only by the step's suite cases, run three times at each level.** Trying two or three effort levels this way, each as a run of its own, is an **effort sweep**. A change of effort changes the output, so it is checked the way the output can fail: on the suite, never on the bill alone.

Anthropic's own measurement shows why. On a set of coding tasks, Opus 5.5 at `low` effort passed 87.4% for $0.11 a task. At `medium` it passed 92.8% for $0.21, and at `high` 95.3% for $0.29.[^anthropic-cost-and-intelligence] Divide each cost by its pass rate. This is our arithmetic, from Anthropic's numbers. It gives about $0.13, $0.23 and $0.30 for each task passed. So `low` is the cheapest for each task passed, and it also loses the most tasks. For Brightline, a lost case is an invoice on Ana's desk. The same page reports a mixed plan. Run at `low`, then run the failures again at `high`. That passes about 97% at about $0.17 a task.[^anthropic-cost-and-intelligence]

So a lower effort is kept only if it passes as many of the step's cases as the current setting, by 29.3's keep rule. Then the next week's gate counts confirm it.

### How much should a prompt say?

**As much as the suite shows it needs, and no more.** Every sentence of the rules is input on every request, twice for each invoice. A cache makes a repeated sentence cheaper (29.7), not free. So the length of a prompt is a cost too.

Set it the way you set effort: by evaluation, not habit. Do not add a sentence "to be safe", and do not cut one to save tokens, without the suite. Both change the output. In Lab 25 a broad rewrite turned two green cases red, because each rested on one sentence ([25.6](../prompts-and-structured-output/revising-from-a-failing-case.md)). Cut a sentence only when the suite still passes without it. Add one only when a case fails without it.

**The operating rule:** set effort and `max_tokens` in code, the same on every request of a step. Change either one, or the prompt's length, only on a measured result from the step's suite cases.

**Do this now.** Ask your coding agent to find the settings that shape output in your own worker. Copy this line:

> Show me, for each place in this project that calls a model, the model id, the effort, the max_tokens and the thinking setting, and say which ones are left to the model's default. Then tell me what the default effort is for that model. Change no file.

<!-- EDITOR: this part adds two source ids beyond the brief's shared list: anthropic-migration-guide-haiku (29.5 uses both migration guides' checklists) and anthropic-fast-mode (29.3's latency lever). The other option: cite only the Opus 5.5 guide, and drop fast mode from 29.3. -->

[^anthropic-thinking]: Building with extended thinking, Anthropic, read November 30, 2026.
[^anthropic-thinking-steering]: Steering thinking and cost, Anthropic, read November 30, 2026.
[^anthropic-effort]: Effort, Anthropic, read November 30, 2026.
[^anthropic-cost-and-intelligence]: Optimizing for cost and intelligence, Anthropic, read November 30, 2026.
[^anthropic-effort-per-message]: Effort per message, Anthropic, read November 30, 2026.
[^anthropic-prompt-caching]: Prompt caching, Anthropic, read November 30, 2026.
