Skip to content
The AI Agent Factory

29.2 Thinking and effort

Approved by
Panaversity ·
16 min read

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.

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). 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.1

Thinking tokens are billed as output tokens, and they count toward max_tokens. The usage shows how many in output_tokens_details.thinking_tokens.2 On Claude 5 models and later, the thinking text is hidden by default. You are billed for all of it either way.1 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.3 Effort affects all output tokens: the text, the tool calls and the thinking.3

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.3 "Setting effort to the model's default ... produces exactly the same behavior as omitting the effort parameter."3

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 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."3 max_tokens is a hard cap on all the output of one request, thinking and text together.2 In a loop of several requests, each request has its own max_tokens, "so it doesn't bound the whole turn's spend".2 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".4 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".2

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). 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".3 Setting it to the model's default is the same as leaving it out, and does not.3

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.5 Anthropic measured a change on the request costing 20 to 40 times a change by message.4 A change to the thinking setting always breaks the cached messages.6

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".4

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.4 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.4

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). 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.

Check yourself

Question 1 / 8

0 answered

The extraction's config sets no effort. What effort does a request run at on Sonnet 5.5, and on Haiku 5.5?

  1. Building with extended thinking, Anthropic, read November 30, 2026.↑↑2
  2. Steering thinking and cost, Anthropic, read November 30, 2026.↑↑2↑3↑4
  3. Effort, Anthropic, read November 30, 2026.↑↑2↑3↑4↑5↑6↑7
Owner
Panaversity