Skip to main content

31 - Claude Effort and Adaptive Thinking: Measure the Right Level Instead of Guessing It

Claude's effort is not one scale for every model: how to measure the right level on your own task with a sweep and an automatic test.

What do you think about this article?

31 - Claude Effort and Adaptive Thinking: Measure the Right Level Instead of Guessing It
Claudefedericocalo.dev

At a Glance

Claude's effort is not one scale for every model: how to measure the right level on your own task with a sweep and an automatic test.

The problem: after the model change the session costs more

You changed the model name, the code has no new error, and a week later the spend is different: higher, or the same but with less solid answers. Almost always the cause is the effort level, which you did not touch and so never suspected. Effort is a signal of how hard the model should try (how many tokens it spends on text, on tool calls and on reasoning) and it is not the same scale for every model: according to the official page it has a different default from one model to the next, and the same page asks you to repeat the test on your own work instead of carrying over the setting of the previous generation.

The short answer is a method in three moves. Pick a task you repeat often and whose outcome is decided by a command (a test that passes or fails). Run it several times for each level, each level in a separate session. Compare the levels on the cost per successful run, not on the cost per run: a level that costs half and fails one time in two is not cheaper. This article builds the script that does the comparison, tries it with a fake client (so you see what the script does, with no judgement on the model) and tells you what the comparison cannot tell you. To know which model you are really using, start from Which Claude Model to Use: Aliases, Pinned Versions and What Changes by Provider; the snapshot of the previous generation is in Opus 4.6 and Sonnet 4.6: Adaptive Thinking and 1M Context.

What effort really controls, and what it does not

A kitchen comparison: effort is the time the chef spends on a dish, not the recipe. An omelette made in minimum time is still an omelette, but a risotto made in minimum time is a different dish. In the same way, a simple task at a low level is solved well; a hard task at a low level is solved worse, and you only find the gap by trying. According to the official guide (accessed 2026-11-14) effort acts on all the tokens of the response, not only on reasoning:

  • the text of the answer and the explanations;
  • the tool calls and their arguments (at a low level, fewer and more concise calls);
  • the reasoning, when it is on.

The third point matters if you read costs: the level also changes how much Claude checks its own work before handing it over, and so how many times it rereads a file or reruns a test. The guide defines it as a behavioural signal and not a hard token cap. That is why looking at the length of the answer is not enough: with the same prompt the length changes little, while the spend and the care change. And that is why the only way to know where you stand is to measure on your own task.

The sweep: same task, different levels, automatic judge

The script below launches claude -p in non-interactive mode for each level, in a clean copy of a task folder, and then runs your tests to decide whether the run succeeded. I kept argv_claude separate from the execution on purpose: the command line can be printed and reread before spending a cent. The options used (--model, --effort, --output-format json, --max-budget-usd, --permission-mode) I checked in the help of the Claude Code 2.1.325 installed here; the cost comes from the total_cost_usd field of the JSON, which the documentation declares to be an estimate computed by the client and not your invoice.

sweep.py - template to adapt: it needs a key and your task
"""Sweep dell'effort: stesso compito, stesso modello, livelli diversi, esito deciso dal TUO test."""
import json
import statistics
import subprocess
import sys
import time
from pathlib import Path

LIVELLI = ("low", "medium", "high", "xhigh")
PROMPT = "Correggi il bug in prezzo.py in modo che i test passino. Non toccare i test."


def argv_claude(modello, livello, tetto_usd):
    """La riga di comando di UNA prova: separata dall'esecuzione, cosi' si puo' stampare e rileggere."""
    return ["claude", "-p", PROMPT, "--model", modello, "--effort", livello,
            "--output-format", "json", "--max-budget-usd", str(tetto_usd),
            "--permission-mode", "acceptEdits"]


def prova(cartella, modello, livello, tetto_usd=0.50):
    """Esegue una prova nella cartella (una copia pulita del compito) e restituisce una riga di risultati."""
    t0 = time.monotonic()
    giro = subprocess.run(argv_claude(modello, livello, tetto_usd), cwd=cartella,
                          capture_output=True, text=True, timeout=1800)
    secondi = time.monotonic() - t0
    try:
        costo = float(json.loads(giro.stdout).get("total_cost_usd", 0.0))
    except (json.JSONDecodeError, ValueError, TypeError):
        costo = None  # niente JSON: la prova resta nella tabella ma non entra nelle medie di costo
    verdetto = subprocess.run([sys.executable, "-m", "unittest", "-q"], cwd=cartella,
                              capture_output=True, text=True)
    return {"modello": modello, "livello": livello, "riuscita": verdetto.returncode == 0,
            "costo_usd": costo, "secondi": round(secondi, 2)}


def riassumi(righe):
    """Una riga per livello: tasso di riuscita, costo medio, tempo mediano, costo per prova riuscita."""
    tabella = []
    for livello in LIVELLI:
        r = [x for x in righe if x["livello"] == livello]
        if not r:
            continue
        ok = sum(1 for x in r if x["riuscita"])
        costi = [x["costo_usd"] for x in r if x["costo_usd"] is not None]
        spesa = sum(costi)
        tabella.append({"livello": livello, "prove": len(r), "riuscite": ok,
                        "costo_medio": round(statistics.mean(costi), 4) if costi else None,
                        "secondi_mediani": round(statistics.median(x["secondi"] for x in r), 2),
                        "costo_per_riuscita": round(spesa / ok, 4) if ok and costi else None})
    return tabella


def stampa(tabella):
    print(f"{'livello':8} {'prove':>5} {'riuscite':>8} {'costo medio':>12} {'s mediani':>9} {'$/riuscita':>11}")
    for t in tabella:
        print(f"{t['livello']:8} {t['prove']:>5} {t['riuscite']:>8} {str(t['costo_medio']):>12} "
              f"{t['secondi_mediani']:>9} {str(t['costo_per_riuscita']):>11}")


def main(modello, ripetizioni, sorgente):
    righe = []
    for livello in LIVELLI:
        for _ in range(ripetizioni):
            copia = Path(subprocess.run(["mktemp", "-d"], capture_output=True, text=True).stdout.strip())
            subprocess.run(["cp", "-r", f"{sorgente}/.", str(copia)], check=True)
            righe.append(prova(copia, modello, livello))
    stampa(riassumi(righe))


if __name__ == "__main__":
    main(sys.argv[1], int(sys.argv[2]), sys.argv[3])

Three lines matter. --max-budget-usd puts a cap on every run: without it, a mistake in the task or a high level on a hard problem consumes as much as it likes. secondi = time.monotonic() - t0 measures the time from the outside, because I do not want to depend on the name of a field that might change. And the verdict comes from unittest, not from Claude's text: the model can declare it has finished, the test cannot. If you remove the automatic judge, the sweep measures how sure of itself Claude is, which is a different thing. I could not run the script against a model: the key is missing, and I declare it a "template to adapt". What I did run is the command line it builds, for the low level:

command line built by argv_claude (executed)
python3 -c "import sweep; print(' '.join(sweep.argv_claude('claude-opus-5-5','low',0.5)))"

# Output:
# claude -p Correggi il bug in prezzo.py in modo che i test passino. Non toccare i test. --model claude-opus-5-5 --effort low --output-format json --max-budget-usd 0.5 --permission-mode acceptEdits

Trying the tool without a model: the fake client

Before putting a key into the script it is worth knowing that the script does its job: it counts, it divides, it does not break when a JSON is missing. So I tried it with a fake executable called claude, placed in front of the real one in the PATH, which reads only --effort, prints a fixed cost per level and "fixes" the task's bug (a VAT computed by dividing by 10 instead of 100) only from medium upwards.

fakebin/claude - a fake client: it is NOT a model
#!/usr/bin/env python3
"""Finto 'claude': rispetta solo --effort e stampa un JSON con total_cost_usd. NON e' un modello."""
import json
import sys
from pathlib import Path

costi = {"low": 0.02, "medium": 0.05, "high": 0.09, "xhigh": 0.21}
livello = sys.argv[sys.argv.index("--effort") + 1]
if livello != "low":  # il finto "ripara" il bug solo da medium in su
    Path("prezzo.py").write_text(
        "def con_iva(netto, aliquota=22):\n    return round(netto * (1 + aliquota / 100), 2)\n")
print(json.dumps({"type": "result", "total_cost_usd": costi[livello]}))
prova_con_finto.py - run with PATH=fakebin:$PATH, 2 runs per level
import sys
sys.path.insert(0, ".")
import sweep
sweep.main("modello-di-prova", 2, "compito")

# Output:
# livello  prove riuscite  costo medio s mediani  $/riuscita
# low          2        0         0.02      0.09        None
# medium       2        2         0.05      0.14        0.05
# high         2        2         0.09      0.23        0.09
# xhigh        2        2         0.21      0.16        0.21

Look at what was demonstrated and what was not. The table shows that the script sums the costs, counts the successes and computes the cost per success (low has two runs and zero successes, so the column stays empty instead of dividing by zero). The cost and success numbers, on the other hand, are the ones I wrote into the fake: they say nothing about any model, and quoting them as a result would be an invention. The times depend on the machine and change at every run.

The same lever from the Messages API

If you do not use Claude Code but write code against the API, the level goes in output_config.effort in the request body. Without the field, the model's default applies: writing the default level explicitly gives the same behaviour as omitting it, but it makes readable in the code a choice that would otherwise be implicit, and that changes when the model changes.

body.py - run with python3 -I (no network: it only builds the body)
"""Il corpo di una richiesta Messages con l'effort scelto: puro, nessuna rete."""
import json


def corpo(modello, livello, domanda, max_tokens=8192):
    return {"model": modello, "max_tokens": max_tokens,
            "messages": [{"role": "user", "content": domanda}],
            "output_config": {"effort": livello}}


if __name__ == "__main__":
    print(json.dumps(corpo("claude-opus-5-5", "medium", "Spiega il pattern outbox."), indent=2))

# Output:
# {
#   "model": "claude-opus-5-5",
#   "max_tokens": 8192,
#   "messages": [
#     {
#       "role": "user",
#       "content": "Spiega il pattern outbox."
#     }
#   ],
#   "output_config": {
#     "effort": "medium"
#   }
# }

The corpo function separates the construction of the request from its sending, and this has a practical advantage: you can write a test that checks that every call in your code carries the intended level, without calling the network. Two warnings from the documentation, for the high levels: max_tokens is a hard limit on the total output, reasoning included, so at xhigh and max it has to be raised; and the length of the answer changes little with effort, so to shorten it you work on the prompt.

Reading the table: the cost per success decides, and failure is paid for

With real data in hand, the question is which level to pick. The most honest criterion is the cost per successful run: the total spend of all the runs of the level (failed ones included, because a failed attempt consumes its tokens) divided by the number of successes. Three trade-offs to keep in mind when you read the result:

  • a low level costs less per run but, if it fails often, it can cost more per success and leaves you the work of redoing it;
  • a high level rises in cost faster than quality rises: above a certain threshold you buy a few points with many tokens;
  • three or five repetitions per level are the minimum, because a single run can come out well or badly by chance.

The second point is the one the official guide documents with its own measurements, attributed to it and not reproduced here: on a subset of a bug-fixing benchmark, for Opus 5.5 the rate of solved tasks rises from low to xhigh much less than proportionally to the spend (figures in the dated block below). A simple policy follows, also described by the guide: if the outcome is verifiable, run everything at a low level and rerun at a higher level only the failed tasks. Your automatic test, the one used as a judge, is exactly what makes this applicable.

Status as of 2026-11-14: defaults and constraints by model

This block ages in weeks: the values were reread on the official pages on 2026-11-14 ("Effort" and "Models overview" pages). Reread the "Effort" page before depending on it. The defaults in the table are those of the Messages API; in Claude Code the default is a different one (see below the table).

Model (ID)Default effort (API)Reasoning off
Opus 5.5 (claude-opus-5-5)mediumthinking: disabled returns 400 at every level
Sonnet 5.5 (claude-sonnet-5-5)highbetween_tools at low, medium, high; at xhigh and max it gives 400
Haiku 5.5 (claude-haiku-5-5)mediumdisabled up to high; at xhigh and max it gives 400
Fable 5.2 (claude-fable-5-2)highadaptive reasoning always on

Pay attention to where you launch the test: the Claude Code "Model configuration" page gives medium as the default for all four models in the table (Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5). A sweep run with claude -p therefore starts from a different point than an API call without output_config: that is why the script always passes --effort explicitly.

According to the guide (Anthropic's measurements, not reproduced here) on a subset of SWE-bench Pro Opus 5.5 solved 87.4% of the tasks at low for 0.11 USD per task, 92.8% at medium for 0.21, 95.3% at high for 0.29 and 96.7% at xhigh (a single run) for 0.74. These are numbers from their own benchmark, on their own workload: they serve to show the shape of the curve, not to predict yours.

What stays true with the next generation

Names and defaults will change; the method will not. It stays true that effort is measured per task and per model, that an automatic judge is worth more than a judgement by eye, that cost is compared per successful run, and that each level has to be tried in a separate session (the guide warns that changing the top-level effort halfway through a session can invalidate the prompt cache and distort the comparison; on the models that support it, a change of effort for a single message preserves it). When a new model comes out, rerun the sweep: it is an operation you can automate and rerun at every change, against the risk of spending for weeks at the wrong level.

What I did not verify

I did not run the sweep on a real model: no key, and no cost or success rate in this article comes from a test of mine on Claude. I did not read the page dedicated to adaptive reasoning or the per-model prompting pages. The total_cost_usd field is a client estimate: for the real spend, the billing panel counts.

Frequently asked questions

Which effort level should I start with?

The model's default, because it is the point the vendor calibrated: on the API the guide gives medium for Opus 5.5 and Haiku 5.5 and high for Sonnet 5.5 and Fable 5.2; in Claude Code the configuration page gives medium for all four. Then you go down or up only where your measurement shows the quality holds.

Can I turn reasoning off to save money?

It depends on the model: on Opus 5.5 a request with thinking: disabled returns 400 at every level, on Sonnet 5.5 you use between_tools, on Haiku 5.5 disabled works up to high. To get less reasoning the uniform method is to lower the effort.

Does the sweep cost too much to be worth it?

It depends on the task and on the number of runs, and I cannot give you a figure I have not measured. Every run has a cap through --max-budget-usd, so the maximum is known before you start: multiply the cap by levels and repetitions. The comparison is with the cost of staying for months at the wrong level.

What you can do now

You know that effort controls all the tokens and not only reasoning, that the default changes from model to model and that for this reason a level is not carried over from one model to another. You have a script to run the sweep with an automatic judge and a way to try it without spending anything. You can read the result as a cost per successful run and apply the "low first, high only on failures" policy. For the spend side, continue with What a Claude Session Costs.

In this series. Previous article: Which Claude Model to Use: Aliases, Pinned Versions and What Changes by Provider. Next article: A 1M Context Is Not Memory: Compaction and What Gets Lost.

Sources

The body.py script, the construction of the command line and the test with the fake client were run with Python 3 on 2026-11-14; sweep.py against a real model was not run (no key). Model names, defaults and figures were compared with the official pages on 2026-11-14. The code listings and the program outputs are reproduced exactly as in the Italian original, so identifiers, messages and comments inside them are in Italian.

Commenti

Caricamento commenti...

Sign in to comment

New articles and tools on Telegram too

The Telegram channel flags the site's new articles and tools.

Did you like this article?

Explore other content on the blog or discover my projects