Claude Sonnet 5.5 has been out since September 28, and it is the strangest kind of upgrade: the price list did not move — still $2 per million input tokens and $10 per million output — yet Anthropic reports output more than 30% faster and up to 30% lower cost per completed task, and on its own Terminal-Bench 4.0 runs the model scores 70.6% at max effort, ahead of Opus 5.5's 66.4% at xhigh. The catch is that the API changed underneath it. Five patterns that worked fine on Sonnet 5 now return 400 errors, and the effort scale was recalibrated, so a setting that was right on Sonnet 5 is not necessarily right on Sonnet 5.5.

This tutorial does the migration properly. You will build a small effort-sweep harness: one coding task with real tests, run at all five effort levels, graded by pytest, priced to the cent. By the end you will know, for your own workload, which effort level to use — and your code will have survived every breaking change on the way there.

What you'll need#

  • Python 3.11 or newer. The examples use the official anthropic Python SDK, version 2.12.0 at time of writing.
  • An Anthropic API key with billing enabled, as ANTHROPIC_API_KEY in your environment. Sonnet 5.5 is available on the Claude API, Amazon Bedrock (anthropic.claude-sonnet-5-5), Google Cloud, and Microsoft Foundry.
  • A few dollars of API credit. A full five-level sweep of the task in this tutorial costs on the order of ten to thirty cents at list prices. The worked cost examples below use the published rates: $2 input / $10 output per million tokens, 5-minute cache writes $2.50, 1-hour writes $4.00, cache reads $0.10 (cut from $0.20 on October 7, 2026), Batch API $1 / $5.
  • pytest, for grading. The harness runs it for you.

Every code block in this tutorial was checked against the installed SDK before publication — including the request shapes, the parameter names, and the error paths — using a mocked transport standing in for the API, so no live key was needed for verification. The model itself only replies when your key is in the environment.

1. Install and verify#

Create a project directory and install the pinned SDK. Pinning matters here: Sonnet 5.5's parameters (output_config.effort, the new thinking modes) only exist on recent SDK versions, and the verification below ran against 2.12.0.

mkdir sonnet55-sweep
cd sonnet55-sweep
python3 -m venv .venv
source .venv/bin/activate
pip install "anthropic==2.12.0" pytest

Confirm the install, then prove your key and the model ID are both valid without spending a token on generation. The Models API returns the model's display name and limits:

pip show anthropic | grep Version
python3 -c "import anthropic; print('anthropic SDK', anthropic.__version__)"
from anthropic import Anthropic

client = Anthropic()  # reads ANTHROPIC_API_KEY from the environment
model = client.models.retrieve("claude-sonnet-5-5")
print(model.id, "·", model.display_name, "·", model.created_at)
anthropic SDK 2.12.0
claude-sonnet-5-5 · Claude Sonnet 5.5 · 2026-09-28T00:00:00Z

If models.retrieve raises an authentication error, your key is the problem, not the model ID. If it raises a 404, you are on an SDK too old to know this model — upgrade.

2. Your first Sonnet 5.5 call#

One parameter carries most of what is new. Effort lives in output_config.effort and takes five values — low, medium, high, xhigh, max. The API defaults to high when you omit it; Claude Code and the Claude apps default to medium. Set it explicitly anyway: the default is the first thing a reader of your code should be able to see.

from anthropic import Anthropic

client = Anthropic()
resp = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=4096,
    output_config={"effort": "high"},
    messages=[
        {"role": "user", "content": "Explain what a prefix check is, in one paragraph."}
    ],
)

text = "".join(block.text for block in resp.content if block.type == "text")
print(text)
print(resp.stop_reason)          # "end_turn" when the reply is complete
print(resp.usage.input_tokens, "in /", resp.usage.output_tokens, "out")

Read the response by block type, not by position. Sonnet 5.5 thinks out loud between tool calls, and those notes arrive as thinking blocks — with an empty thinking field and a signature, unless you ask for summaries with thinking={"type": "adaptive", "display": "summarized"}. The first block of a reply is often a thinking block, so resp.content[0].text will either be empty or raise. Filter on block.type == "text" and the problem disappears.

Two numbers from the spec sheet shape everything that follows: a 1,000,000-token context window and a 128,000-token maximum output (300,000 on the Batch API with the output-300k-2026-03-24 beta header). The context is billed at the standard rate — a 900,000-token request costs the same per token as a 9,000-token one.

3. The task the sweep will grade#

A sweep needs a task with an objective verdict. Ours is small and honest: implement parse_duration, a function that turns strings like "1h30m" into seconds. The starter file is deliberately broken, and the tests are fixed — the agent may not edit them.

Save this as tasks/duration/duration.py:

"""Parse human durations like "1h30m" into seconds. (Starter: broken.)"""
import re

_UNITS = {"d": 86400, "h": 3600, "m": 60, "s": 1}


def parse_duration(text: str) -> float:
    """'1h30m' -> 5400.0, '90s' -> 90.0, '2d' -> 172800.0.

    Accepts an optional space between parts and a fractional value
    ('1.5h' -> 5400.0). Raises ValueError on anything unparseable.
    """
    raise NotImplementedError("implement me")


def format_duration(seconds: float) -> str:
    """5400.0 -> '1h30m'. Inverse of parse_duration for whole values."""
    if seconds < 0:
        raise ValueError("negative duration")
    parts = []
    remaining = int(seconds)
    for unit, size in (("d", 86400), ("h", 3600), ("m", 60), ("s", 1)):
        value, remaining = divmod(remaining, size)
        if value:
            parts.append(f"{value}{unit}")
    return "".join(parts) or "0s"

And this as tasks/duration/test_duration.py:

import pytest

from duration import format_duration, parse_duration


def test_compound():
    assert parse_duration("1h30m") == 5400.0
    assert parse_duration("1h 30m") == 5400.0
    assert parse_duration("2d3h4m5s") == 2 * 86400 + 3 * 3600 + 4 * 60 + 5


def test_single_units():
    assert parse_duration("90s") == 90.0
    assert parse_duration("45m") == 2700.0
    assert parse_duration("2d") == 172800.0


def test_fractional():
    assert parse_duration("1.5h") == 5400.0


def test_invalid():
    with pytest.raises(ValueError):
        parse_duration("abc")
    with pytest.raises(ValueError):
        parse_duration("")
    with pytest.raises(ValueError):
        parse_duration("1x")


def test_format_roundtrip():
    assert format_duration(5400.0) == "1h30m"
    assert format_duration(0) == "0s"

Five tests, three failure modes (compound parsing, fractions, invalid input), one file to fix. It is deliberately too easy for max and borderline for low — that spread is the point. A sweep where every level passes tells you nothing; a sweep where the cheap levels fail and the expensive ones pass tells you where your money goes.

Diagram of the effort sweep: one coding task copied fresh for each of the five effort levels, each run graded by pytest and priced from its usage object
The sweep: one task, five fresh copies, one effort level each — graded by pytest and priced from the usage object. Diagram: AI Frontier Post.

4. The agent loop#

The loop the sweep drives is intentionally minimal: three tools (read_file, write_file, run_tests), an append-only history, and cost accounting that separates fresh, cached, and written tokens. Save it as agent_loop.py. Every Sonnet 5.5 rule that matters is already baked in — the next section explains each one.

"""Append-only agent loop for Claude Sonnet 5.5 (anthropic SDK 2.12.0).

Verified against the installed SDK with a mocked transport (see
sonnet55_verify.py): every request shape, parameter, and error path in this
file is exactly what the SDK sends. The model itself only replies when your
ANTHROPIC_API_KEY is in the environment.
"""
import subprocess

MODEL = "claude-sonnet-5-5"

PRICES = {  # USD per million tokens (Anthropic pricing page, Nov 2026)
    "input": 2.0, "output": 10.0,
    "cache_write_5m": 2.50, "cache_write_1h": 4.0, "cache_read": 0.10,
}


def cost_of(usage, cache_ttl="5m"):
    """USD cost of one response's usage object (dict-like)."""
    inp = usage.get("input_tokens", 0)
    out = usage.get("output_tokens", 0)
    created = usage.get("cache_creation_input_tokens", 0)
    read = usage.get("cache_read_input_tokens", 0)
    fresh = inp - created - read
    write_price = PRICES["cache_write_1h"] if cache_ttl == "1h" else PRICES["cache_write_5m"]
    return (fresh * PRICES["input"] + created * write_price
            + read * PRICES["cache_read"]
            + out * PRICES["output"]) / 1e6


def read_file(path: str) -> str:
    """Local tool: read a file from the working tree."""
    with open(path) as f:
        return f.read()[:4000]


def write_file(path: str, content: str) -> str:
    """Local tool: overwrite a file with new content."""
    with open(path, "w") as f:
        f.write(content)
    return f"wrote {len(content)} chars to {path}"


def run_tests(path: str = ".") -> str:
    """Local tool: run pytest in a directory, return the tail of the output."""
    proc = subprocess.run(
        ["python3", "-m", "pytest", "-q", path],
        capture_output=True, text=True, timeout=120,
    )
    tail = (proc.stdout + proc.stderr)[-1500:]
    return f"exit={proc.returncode}\n{tail}"


# Strict tools need additionalProperties: false on every object in the
# schema, and at most 20 strict tools per request (migration guide).
TOOLS = [
    {
        "name": "read_file",
        "description": "Read a file from the project and return its contents.",
        "input_schema": {
            "type": "object",
            "properties": {"path": {"type": "string"}},
            "required": ["path"],
            "additionalProperties": False,
        },
        "strict": True,
    },
    {
        "name": "write_file",
        "description": "Overwrite a file with new content.",
        "input_schema": {
            "type": "object",
            "properties": {
                "path": {"type": "string"},
                "content": {"type": "string"},
            },
            "required": ["path", "content"],
            "additionalProperties": False,
        },
        "strict": True,
    },
    {
        "name": "run_tests",
        "description": "Run pytest in a directory and return the result.",
        "input_schema": {
            "type": "object",
            "properties": {"path": {"type": "string"}},
            "required": ["path"],
            "additionalProperties": False,
        },
        "strict": True,
    },
]


def run_agent(client, messages, effort="high", max_tokens=16384,
              max_turns=10, thinking=None):
    """Run one append-only agent loop.

    Returns (final_text, usage, history). History is append-only: every
    assistant turn goes back exactly as returned, tool results appended as
    new turns. Editing an earlier turn (or the system prompt, or the tools)
    after a thinking block exists fails the model's prefix check.
    """
    tool_fns = {"read_file": read_file, "write_file": write_file,
                "run_tests": run_tests}
    history = list(messages)  # append-only from here on
    total_usage = {"input_tokens": 0, "output_tokens": 0,
                   "cache_creation_input_tokens": 0,
                   "cache_read_input_tokens": 0}
    final_text = ""
    kwargs = dict(
        model=MODEL,
        max_tokens=max_tokens,
        output_config={"effort": effort},
        tools=TOOLS,
        tool_choice={"type": "auto"},  # never "any" or a named tool: 400
    )
    if thinking is not None:
        kwargs["thinking"] = thinking
    for _ in range(max_turns):
        resp = client.messages.create(messages=history, **kwargs)
        u = resp.usage
        for key in total_usage:
            total_usage[key] += getattr(u, key, 0) or 0
        history.append({"role": "assistant", "content": resp.content})
        # Notes the model writes between tool calls arrive as thinking
        # blocks, not text. Read by block type, never resp.content[0].
        final_text = "".join(
            block.text for block in resp.content if block.type == "text")
        if resp.stop_reason == "end_turn":
            return final_text, total_usage, history
        if resp.stop_reason != "tool_use":
            return final_text, total_usage, history
        tool_results = []
        for block in resp.content:
            if block.type != "tool_use":
                continue
            result = tool_fns[block.name](**block.input)
            tool_results.append({
                "type": "tool_result",
                "tool_use_id": block.id,
                "content": result,
            })
        history.append({"role": "user", "content": tool_results})
    return final_text, total_usage, history

Two details deserve attention. First, cost_of splits the input tokens into three buckets — fresh, cache-created, cache-read — because they are priced differently ($2.00, $2.50, and $0.10 per million). A usage object that only reports input_tokens is hiding most of the bill. Second, the loop never edits history after appending: assistant turns go back exactly as returned, thinking blocks included, even the empty ones. That is not style. It is the prefix check, covered in step 7.

5. Run the sweep#

The sweep driver is deliberately boring: for each effort level, copy the task fresh, run the agent, grade with pytest, record tokens, wall time, and cost. A fresh copy per level matters — a failed attempt at one level must not contaminate the next. Save it as effort_sweep.py:

"""Effort sweep for Claude Sonnet 5.5: run the same coding task at every
effort level and measure pass/fail, tokens, wall time, and cost per task.

Usage:
    python3 effort_sweep.py [--efforts low,medium,high] [--task-dir tasks/duration]

Requires ANTHROPIC_API_KEY. Each level gets a fresh copy of the task, so a
failed attempt at one level cannot contaminate the next.
"""
import argparse
import json
import shutil
import sys
import tempfile
import time
from pathlib import Path

from anthropic import Anthropic

from agent_loop import MODEL, PRICES, cost_of, run_agent

TASK_PROMPT = """Fix duration.py so every test in test_duration.py passes.

Rules: use the tools — read the files, edit with write_file, verify with
run_tests. Do not edit test_duration.py. When the tests pass, reply with a
one-line summary and stop."""

EFFORTS = ["low", "medium", "high", "xhigh", "max"]


def grade(task_dir: Path) -> bool:
    """True when pytest passes in the task directory."""
    import subprocess
    proc = subprocess.run(
        [sys.executable, "-m", "pytest", "-q", str(task_dir)],
        capture_output=True, text=True, timeout=120,
    )
    return proc.returncode == 0


def sweep(client, task_src: Path, efforts):
    rows = []
    for effort in efforts:
        with tempfile.TemporaryDirectory(prefix=f"sweep-{effort}-") as tmp:
            task_dir = Path(tmp) / "task"
            shutil.copytree(task_src, task_dir)
            system = (
                "You are a coding agent. Work in the project directory. "
                "The task files are duration.py and test_duration.py."
            )
            messages = [{
                "role": "user",
                "content": [
                    {"type": "text", "text": system,
                     "cache_control": {"type": "ephemeral"}},
                    {"type": "text", "text": TASK_PROMPT},
                ],
            }]
            start = time.monotonic()
            try:
                _, usage, _ = run_agent(
                    client, messages, effort=effort, max_tokens=32768)
            except Exception as exc:  # API error, timeout, bad key, ...
                rows.append({"effort": effort, "passed": False,
                             "error": type(exc).__name__ + ": " + str(exc),
                             "seconds": round(time.monotonic() - start, 1)})
                continue
            seconds = time.monotonic() - start
            passed = grade(task_dir)
            rows.append({
                "effort": effort,
                "passed": passed,
                "input_tokens": usage["input_tokens"],
                "output_tokens": usage["output_tokens"],
                "cache_read_tokens": usage["cache_read_input_tokens"],
                "seconds": round(seconds, 1),
                "cost_usd": round(cost_of(usage), 4),
            })
    return rows


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--efforts", default=",".join(EFFORTS))
    ap.add_argument("--task-dir", default="tasks/duration")
    ap.add_argument("--out", default="sweep-results.json")
    args = ap.parse_args()
    efforts = [e.strip() for e in args.efforts.split(",") if e.strip()]
    for e in efforts:
        if e not in EFFORTS:
            ap.error(f"unknown effort {e!r}; choose from {EFFORTS}")
    client = Anthropic()  # reads ANTHROPIC_API_KEY
    rows = sweep(client, Path(args.task_dir), efforts)
    print(f"{'effort':<8}{'passed':<8}{'in':>9}{'out':>9}"
          f"{'cached':>9}{'secs':>7}{'cost':>9}")
    for r in rows:
        if "error" in r:
            print(f"{r['effort']:<8}{'ERROR':<8}{r['error'][:60]}")
            continue
        print(f"{r['effort']:<8}{str(r['passed']):<8}{r['input_tokens']:>9,}"
              f"{r['output_tokens']:>9,}{r['cache_read_tokens']:>9,}"
              f"{r['seconds']:>7}{'$' + format(r['cost_usd'], '.4f'):>9}")
    Path(args.out).write_text(json.dumps(rows, indent=2))
    print(f"\nwrote {args.out}")


if __name__ == "__main__":
    main()

Run it:

python3 effort_sweep.py
python3 effort_sweep.py --efforts low,medium,high   # a cheaper first pass

The output is a table with one row per effort level: pass or fail, input and output tokens, cached tokens, seconds, and cost. Your numbers will differ from anyone else's — the same task, the same level, and the model still varies run to run. That is why the sweep grades with tests instead of vibes, and why you should treat one run as a scout, not a verdict. Run the sweep three times on tasks you actually care about before changing a default.

To know what shape to expect, here is the independent reference: Artificial Analysis ran its Intelligence Index (version 4.3.2, October 5, 2026) at every effort level, for Sonnet 5 and Sonnet 5.5 side by side. Scores are the index; cost is what Artificial Analysis spent per task.

EffortSonnet 5.5 score / cost per taskSonnet 5 score / cost per taskCost changeScore change
low36 / $0.4224 / $0.51−18%+12
medium41 / $0.5928 / $1.00−41%+13
high47 / $1.1232 / $1.79−37%+15
xhigh52 / $2.7534 / $2.87−4%+18
max56 / $7.6738 / $5.09+51%+18

Read the table as a curve, not a ranking. low and medium are where Sonnet 5.5 earns its keep: higher scores than Sonnet 5 at its best, for less money. max buys the top score at roughly thirteen times the cost of medium — and on some benchmarks it scores lower than xhigh: on FrontierCode, Anthropic's own numbers put Sonnet 5.5 at 52.1% at xhigh and 46.2% at max, because at max the model more often spins up review subagents that time out or edit out of scope. More effort is not monotonically better. That is exactly what your sweep is for.

6. Prompt caching that survives#

Agent loops repeat the same system prompt and tool definitions every turn. Prompt caching turns those repeats into $0.10-per-million-token reads instead of $2.00 fresh input — but only if the cached prefix actually survives. Two rules decide that.

Rule one: mark the stable prefix, keep the tail fresh. On Sonnet 5.5 the minimum cacheable prompt is 512 tokens, down from 1,024 on Sonnet 5 — small prompts now qualify. Put cache_control on the last stable block, and put the thing that changes on a block after it:

messages = [
    {"role": "user", "content": [
        {"type": "text", "text": CODEBASE_SUMMARY,          # stable: cached
         "cache_control": {"type": "ephemeral", "ttl": "1h"}},
        {"type": "text", "text": "Fix the bug in src/app.py"},  # fresh tail
    ]},
]

The default TTL is 5 minutes; "ttl": "1h" costs $4.00 per million written instead of $2.50, and breaks even after two cache reads instead of one. For an agent loop that turns over in seconds, the 5-minute default is the right choice; for a human-in-the-loop session that pauses between turns, pay for the hour. Read the hit rate off the usage object: cache_read_input_tokens above zero means the cache is working.

Rule two: changing top-level effort can invalidate the cache. The effort level is part of the cache key, so a loop that starts at medium and switches to high mid-conversation can throw the whole cached prefix away. If you need to change effort mid-conversation and keep the cache, use per-message effort instead — a beta feature. Attach output_config to the message itself and send the beta header:

resp = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=4096,
    output_config={"effort": "high"},
    messages=[{"role": "user",
               "content": [{"type": "text", "text": "Summarize this diff.",
                            "output_config": {"effort": "low"}}]}],
    extra_headers={"anthropic-beta": "mid-conversation-output-config-2026-07-01"},
)

Per-message effort needs adaptive thinking: with between_tools thinking, a per-message effort that differs from the level in effect returns a 400. And the sweep's own system prompt is cached for a different reason — every level in the sweep starts from the same messages, so the first call at each level writes the cache and the later turns read it. Watch cache_read_input_tokens in your sweep results: if it stays at zero, the cache is not engaging and you are paying full input price every turn.

7. The five breaking changes#

Anthropic's migration guide lists five changes that turn working Sonnet 5 code into 400 errors on Sonnet 5.5, plus three that mostly bite code migrating from older models. If you are moving an existing integration, fix these before you change the model ID — the model ID is the easy part.

#What breaksErrorThe fix
1thinking: {"type": "disabled"}400thinking: {"type": "between_tools"} — at low/medium/high only; at xhigh/max omit thinking (adaptive) instead
2Forced tool_choice (any or a named tool)400tool_choice: {"type": "auto"} plus strict: true on the tools; say in the prompt that the model should use the tool
3Editing history before a thinking block400 or silently dropped blocksAppend-only history; pass thinking blocks back unchanged, including empty ones
4Old computer-use tools (computer_20251124 on the API, computer_20250124 anywhere)400Use the computer_toolset_20260801 toolset; drop the fine-grained-tool-streaming-2025-05-14 beta header
5Advisor models Sonnet 5, Opus 4.8/4.7/4.6, Sonnet 4.6, Haiku 5.5400Use an accepted advisor: Opus 5/5.5, Sonnet 5.5, Fable 5/5.1/5.2, Mythos 5/5.1/5.2

Change 1 — turning thinking off. Sonnet 5.5 has no off switch for thinking, only a quieter mode. The replacement is between_tools: the model thinks only between tool calls, and the setting accepts no other fields — attach display or budget_tokens to it and that is a second 400. It is also the lowest thinking setting, and it only works at low, medium, or high effort; at xhigh or max it returns a 400, so leave the thinking field out entirely there and let adaptive thinking run. The broken and fixed forms, side by side:

# 400 on Sonnet 5.5 — "send between_tools instead of disabled"
resp = client.messages.create(
    model="claude-sonnet-5-5", max_tokens=4096,
    thinking={"type": "disabled"},
    messages=[{"role": "user", "content": "Classify this ticket."}],
)

# Fixed: between_tools at high effort or below
resp = client.messages.create(
    model="claude-sonnet-5-5", max_tokens=4096,
    output_config={"effort": "high"},
    thinking={"type": "between_tools"},
    messages=[{"role": "user", "content": "Classify this ticket."}],
)

Change 2 — forced tool use. On Sonnet 5 you could force the model to call a tool with tool_choice: {"type": "any"} or {"type": "tool", "name": ...}. Sonnet 5.5 rejects both with a 400, including on the token-counting endpoint. The replacement is auto plus strict tools: mark each tool strict: true with additionalProperties: false on every object in its schema (at most 20 strict tools per request), and put the instruction in the prompt, since the model may now answer without calling the tool. The loop in step 4 already does this — that is why its schemas carry additionalProperties: false.

# 400 on Sonnet 5.5 — forced tool_choice is not supported for this model
resp = client.messages.create(
    model="claude-sonnet-5-5", max_tokens=4096,
    tools=TOOLS, tool_choice={"type": "tool", "name": "read_file"},
    messages=[{"role": "user", "content": "What is in src/app.py?"}],
)

# Fixed: auto + strict tools, instruction in the prompt
resp = client.messages.create(
    model="claude-sonnet-5-5", max_tokens=4096,
    output_config={"effort": "high"},
    tools=TOOLS, tool_choice={"type": "auto"},
    messages=[{"role": "user",
               "content": "Use read_file to read src/app.py, then summarize it."}],
)

Change 3 — the prefix check. Every thinking block is signed over the conversation that produced it. Send the history back with an edit — a rewritten system prompt, a swapped tool definition, a trimmed earlier turn — and the block fails its prefix check. The API may return a 400, or it may return 200 with the unreadable blocks silently dropped (and not billed). Either way your agent loses context it thought it had. Keep conversations append-only, pass thinking blocks back exactly as returned, and when instructions need to change mid-conversation, use mid-conversation system messages (beta header mid-conversation-system-messages-2026-06-22) instead of editing history. One more migration note: Sonnet 5.5 can read thinking blocks produced by Sonnet 5, Opus 4.8, Haiku 4.5, and earlier models, so a conversation started on Sonnet 5 can continue on 5.5 — but thinking blocks only work inside the account that produced them, or a linked account.

Changes 4 and 5 are narrower but just as final: computer use moved to the computer_toolset_20260801 toolset (Bedrock still accepts the old computer_20251124 tool with its beta header; the Claude API does not), and the advisor tool only accepts Opus 5/5.5, Sonnet 5.5, Fable 5/5.1/5.2, and Mythos 5/5.1/5.2 as advisors — Sonnet 5 itself is not on the list. Three more traps from older migrations still apply: thinking: {"type": "enabled"} with a budget is not supported, sampling parameters are gone (SDK 2.12.0 rejects temperature, top_p, and top_k outright with a TypeError before any network call), and assistant prefill is not supported — the conversation must end with a user message.

Diagram of the five breaking changes as a checklist: thinking mode, forced tool choice, history edits, computer-use versions, and advisor models, each with its fix
The five breaking changes and their fixes — check each one before changing the model ID. Diagram: AI Frontier Post.

8. The shortcut: Sonnet 5.5 in Claude Code#

If your "migration" is a person, not a service, the whole tutorial compresses to three commands. Sonnet 5.5 is the default model in Claude Code and the Claude apps, and the effort switch is a slash command:

claude update
claude --model sonnet        # or /model sonnet inside a session
claude --effort high         # or /effort high inside a session

The same rules apply inside Claude Code: the effort scale was recalibrated, so re-run your own version of the sweep — pick three tasks you do every week, run each at medium and high, and keep the level that finishes the job. The API default is high; Claude Code starts at medium. If your agent feels dumber after the upgrade, check the effort level before blaming the model.

Which effort should you use?#

Anthropic's own starting points, confirmed against the numbers above:

WorkloadStart atWhy
Classification, extraction, routing, latency-sensitive chatlowCheapest per task; beats Sonnet 5's best score for less money
Well-specified agentic coding, general chat, summarizationmediumThe value sweet spot: 41 on the AA index for $0.59 a task
Complex reasoning, multi-step agents, code generationhighThe API default; the level most benchmarks are run at
Hardest reasoning, research, advanced codingxhighOutscores max on FrontierCode (52.1% vs 46.2%) for a third of the cost
Maximum quality, no latency concern, measured gain onlymaxTop score on Terminal-Bench (70.6%) at ~13× the cost of medium

The decision rule is one sentence: start at medium for agentic work and high for everything else, step up only where your sweep shows a measured gain, and never pay for max on a task you have not measured. Sonnet 5 stays available as a legacy model until at least June 30, 2027, so there is no deadline forcing the move — but there is also no reason to keep paying Sonnet 5 prices for lower scores once the five fixes are in.

The takeaway#

  1. Effort is the price. The per-token rates did not change from Sonnet 5; the tokens per task did. Measure cost per finished task at each effort level, on your own work, with the sweep in step 5.
  2. Fix the five 400s first. between_tools instead of disabled, auto plus strict tools instead of forced choice, append-only history, the new computer-use toolset, and an accepted advisor model.
  3. Cache the stable prefix and watch the hit rate. 512 tokens now qualifies; a top-level effort change can invalidate the cache, so switch levels per-message if you must switch mid-conversation.
  4. Read responses by block type. Thinking blocks are part of the reply now. Filter for text, pass thinking blocks back verbatim, and never edit history behind them.
  5. Start at medium for agents, high for the rest. Reserve xhigh and max for work where your own numbers prove they help — max can score lower than xhigh.

Sonnet 5.5 is the model most developers will actually live on: half the price of Opus 5.5 per token, faster than Sonnet 5, and close enough to Opus on well-scoped work that the choice is now about effort levels, not model tiers. The migration is an afternoon — a sweep, five fixes, and a cache check — and it pays for itself the first week.

Sources#

  • Anthropic — Introducing Claude Sonnet 5.5 (September 28, 2026) — the launch announcement: 30%+ faster output, up to 30% lower cost per task, and the benchmark table. All benchmark figures in this tutorial are Anthropic's own, vendor-reported numbers.
  • Claude Platform Docs — Migrating to Claude Sonnet 5.5 — the five breaking changes (disabled thinking, forced tool choice, history edits, retired computer-use tools, advisor models), the prefix check, and the per-message effort and mid-conversation system-message betas.
  • Claude Platform Docs — Claude Sonnet 5.5 — model overview: 1M-token context, 128K max output, June 2026 knowledge cutoff, default effort high.
  • Claude Platform Docs — Prompting Claude Sonnet 5.5 — recommended starting effort per workload and the caching guidance.
  • Claude Platform Docs — Effort — the five effort levels, the per-surface defaults, and the cache warning on changing top-level effort.
  • Claude Platform Docs — Pricing — $2/$10 per million tokens, cache write $2.50 (5m) / $4.00 (1h), cache read $0.10, Batch API $1/$5.
  • Artificial Analysis — Intelligence Index v4.3.2 (October 5, 2026): the per-effort scores and cost-per-task figures in step 5 are from Artificial Analysis's published side-by-side run of Sonnet 5 and Sonnet 5.5.