Prompting Claude Sonnet 5 (Anthropic docs)
Anthropic’s official prompting guide for Claude Sonnet 5 — the behavioral and API-migration detail behind the model page. T1 primary (platform.claude.com). It runs well on existing Sonnet 4.6 prompts out of the box; what follows is the tuning that the model’s new defaults most often need.
API changes that break Sonnet 4.6 setups
The migration-breaking ones, because they’re hard 400 errors, not soft behavior shifts:
- Sampling parameters removed — setting
temperature,top_p, ortop_kto any non-default value returns a 400 error. New for Sonnet-class models. Steer tone/variety through the system prompt instead. - Manual extended thinking removed —
thinking: {type: "enabled", budget_tokens: N}returns 400 (deprecated on 4.6, now gone). Use adaptive thinking + the effort parameter. - Adaptive thinking on by default — a request with no
thinkingfield now thinks (on 4.6 it didn’t). Disable withthinking: {type: "disabled"}. Revisitmax_tokens, which caps thinking + response together. - New tokenizer → ~30% more tokens for the same text, so
max_tokenslimits tuned for 4.6 may truncate Sonnet 5 output. This is also a real cost point — see synthesis.
The effort parameter (capability ⇄ token spend)
The main intelligence/cost lever (cost angle): low / medium / high / xhigh / max,
defaulting to high. xhigh is recommended for the hardest coding/agentic work. The cross-model
mapping is the striking part: Sonnet 5 at medium ≈ Sonnet 4.6 at high, and Sonnet 5 at high ≈
Sonnet 4.6 at max — i.e. more intelligence per effort tier than the prior gen. Sonnet 5 also respects
effort strictly (scopes work to what’s asked at low/medium), so raise effort rather than prompt around
shallow reasoning.
Behavioral shifts to prompt against
- More agentic by default — reaches for tools and runs self-verification loops more readily than 4.6; with thinking disabled it tools less, so nudge explicitly if you rely on tool calls.
- More literal instruction-following — doesn’t silently generalize an instruction across items or infer unrequested work (precision up; state scope explicitly, e.g. “every section, not just the first”). Better for structured extraction and tuned pipelines.
- Verbosity calibrated to task complexity rather than a fixed length — tune if your product needs a set style.
- Better built-in progress updates on long agentic traces — remove old “summarize every 3 tool calls” scaffolding.
- Code-review recall drop is usually a harness effect, not a regression — Sonnet 5 obeys “only report high-severity / don’t nitpick” more faithfully, so it investigates as deeply but reports fewer low-severity findings (precision up, measured recall down). Fix: tell the finding stage its job is coverage and move confidence-filtering to a separate step.
- Settles into a default frontend “house style” — break it by specifying a concrete alternative or
asking the model to propose visual directions first (the recommended substitute for
temperaturevariety, now that it’s unavailable). - Computer use — supports
computer_20251124, up to 2576px/3.75MP; 1080p is the cost/performance sweet spot.
Why it’s here
It’s the operational underside of the claude-sonnet-5 market story: the effort-tier uplift and the ~30%-heavier tokenizer both bear on the spoke’s cost/capability threads. The harness-facing advice (agentic tool use, autonomy, code-review coverage) is agentic-tooling-wiki territory, cross-linked; the inference-mechanics of adaptive thinking sit nearer llm-inference-wiki.
Related
claude-sonnet-5 · claude-sonnet-5-system-card · anthropic · llm-api-pricing · artificial-analysis · synthesis