On Monday night I pointed a small script — the one that tidies store announcements into several languages for my apps — at claude-sonnet-5-5, then ran the scanner I had written earlier to catch parameters that return a 400. It came back clean. I was about to close the terminal.
What stopped me was one line near the end of the migration guide: "Revisit max_tokens." I had checked whether anything errored. I had not once looked at whether the responses still looked the same.
The short version: getting rid of the 400s is the start of this migration, not the end. And you can only compare before and after while the old model still answers — that is, until November 30. That is what makes this deadline awkward.
The dates and the replacement ID
The official deprecations table lists claude-sonnet-4-5-20250929 as deprecated on September 30, 2026, with retirement on November 30, 2026. The same page says the retirement includes claude-sonnet-4-5, the undated alias. Calling the alias doesn't get you out of it.
The recommended replacement is claude-sonnet-5-5, which has no date suffix. I covered pricing and tokenizer differences, and the parameters that now return a 400, in two earlier pieces (checking the billing difference and a scanner for 400-causing arguments). This one is only about what changes while still returning 200.
Three things that change without a 400
I reread the official guide, "Migrating to Claude Sonnet 5.5," sorting each item into "errors" and "doesn't error." On the quiet side, three items mattered for my script.
| What changes | Sonnet 4.5 | Sonnet 5.5 | Why it's easy to miss |
|---|---|---|---|
A request with no thinking field | Runs without thinking | Runs with adaptive thinking by default | You never set it, so it never shows up in a diff |
Order of content | Text comes first | A thinking block can come first | content[0].text is empty or throws |
What max_tokens covers | Mostly the answer | Thinking plus the answer | The answer gets cut and stop_reason becomes max_tokens |
On top of that, the guide says the same text produces about 30 percent more tokens than on Sonnet 4.5. Add the thinking, and the same max_tokens leaves far less room for the answer.
One more: Sonnet 5.5 declines in more categories. A decline comes back as stop_reason: "refusal", with a category such as cyber or general_harms in stop_details. The guide notes that benign work can also trigger general_harms.
Thinking text is omitted by default, too: thinking blocks arrive with an empty thinking field and a signature. If you used to log thinking, your log will simply go blank.
Read the answer by block type
First, get rid of anything that assumes content[0] is the answer. This function collects the text and records how the response ended, in one row.
# What it solves: don't lose the answer when a thinking block comes first,
# and record stop_reason and token use side by side.
def summarize(response):
texts = []
thinking_blocks = 0
for block in response.content:
if block.type == "text":
texts.append(block.text)
elif block.type == "thinking":
thinking_blocks += 1 # by default the text is empty; only the signature is set
body = "".join(texts)
details = getattr(response, "stop_details", None)
return {
"model": response.model,
"stop_reason": response.stop_reason,
"stop_details": str(details) if details else "",
"thinking_blocks": thinking_blocks,
"output_tokens": response.usage.output_tokens,
"body_chars": len(body),
"body": body,
}output_tokens includes thinking. I keep the answer's character count next to it so that "more output, shorter answer" jumps out.
Run the same requests on both models while you still can
This is the deadline part. After November 30, the old model's column can never be filled in. Pick five to ten representative requests from your real traffic, send them to both models with the same settings, and keep the result as a CSV.
# What it solves: send identical requests to Sonnet 4.5 and 5.5 and compare how they end.
# The old model fails after retirement, so run this once before November 30.
import csv
import anthropic
client = anthropic.Anthropic()
MODELS = ["claude-sonnet-4-5-20250929", "claude-sonnet-5-5"]
MAX_TOKENS = 1024 # use the value your production code sends today
prompts = [line.strip() for line in open("prompts.txt", encoding="utf-8") if line.strip()]
with open("compare.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow(["prompt_no", "model", "stop_reason", "stop_details",
"thinking_blocks", "output_tokens", "body_chars"])
for i, prompt in enumerate(prompts, 1):
for model in MODELS:
try:
r = client.messages.create(
model=model,
max_tokens=MAX_TOKENS,
messages=[{"role": "user", "content": prompt}],
)
except anthropic.APIStatusError as e:
writer.writerow([i, model, f"HTTP {e.status_code}", "", "", "", ""])
continue
s = summarize(r) # the function from the previous section
writer.writerow([i, model, s["stop_reason"], s["stop_details"],
s["thinking_blocks"], s["output_tokens"], s["body_chars"]])I deliberately leave out thinking and output_config. If your production code doesn't set them, the difference you need to see is the difference in that unset state. Add settings after you've looked.
When reading the CSV, I check three things on the 5.5 rows first: is stop_reason max_tokens, is body_chars clearly shorter than on 4.5, and is there any refusal?
What to do with each difference
| What the CSV shows | First thing to try | Watch out for |
|---|---|---|
Stopped at max_tokens, with thinking blocks | Turn off up-front thinking with thinking: {"type": "between_tools"} | disabled returns a 400 on 5.5; between_tools only works at low to high effort |
Stopped at max_tokens, no thinking | Raise max_tokens | Allow for roughly 30 percent more tokens |
Short answer, but end_turn | Set output_config.effort explicitly and compare again | 4.5 had no effort; the API default is high |
refusal | Log the stop_details category and revisit the request | Server-side fallback retries only some categories |
For my own script, translation drafts don't need thinking time, so I'm leaning toward adding between_tools and leaving max_tokens alone. For requests where I do want a bit of reasoning, like summarising, I keep thinking on and widen max_tokens instead. Splitting by request type inside the same script turned out to be the simpler answer.
One more thing: the old trick of continuing a truncated answer by prefilling the assistant turn returns a 400 on 5.5. To ask for a continuation, put the cut-off text in the user message and ask the model to carry on from there.
Find the hard-coded content[0]
Last, list every place that reads the answer from content[0]. As an indie developer I can tell you the small scripts are exactly where this hides, usually in one line.
# What it solves: list every place that assumes the first block is the answer
grep -rnE 'content\[0\]\.text|content\[0\]\["text"\]|\.content\[0\]' --include='*.py' --include='*.ts' --include='*.js' .Replace each hit with a read-by-type approach like summarize above, then run the comparison again and check that body_chars lines up.
The line I'm drawing for this deadline
Where I went wrong at first was treating "no errors" as the pass mark. A 400 is the kind failure — it stops you. A 200 with different contents is far harder to catch.
Errors are where a migration starts; comparison runs until the day before retirement. I'd like to keep that order for the next model swap too.
If you can, write five of your everyday requests into prompts.txt and run the comparison once today. After November 30, the old model's column stays empty for good.