← ClaudeAtlas

prompting-sonnet-5listed

How to prompt and scaffold Claude Sonnet 5 — the migration-from-4.6 API breakers (sampling params now error, new tokenizer inflates tokens ~30%, extended-thinking budgets removed), adaptive-thinking-on-by-default, effort mapping, tool-use triggering, and design/code-review tuning. Use when starting Sonnet 5 work, picking Sonnet as a subagent model, migrating a 4.6 prompt or n8n/API call, hitting a 400 error on temperature, or seeing max_tokens truncation.
aksheyw/claude-code-learned-skills · ★ 0 · AI & Automation · score 72
Install: claude install-skill aksheyw/claude-code-learned-skills
# Prompting Claude Sonnet 5 > Source: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5 > — snapshot 2026-07-03. If this snapshot is >60 days old and you're doing high-stakes prompt work, > re-fetch and reconcile against the live page. Sonnet 5 performs well out of the box on existing Sonnet 4.6 prompts, but a few **API-level changes will hard- error or silently truncate** if you migrate a 4.6 call unchanged — those are up top. Source: Anthropic's *Prompting Claude Sonnet 5* guide, tuned to Claude Code subagent selection + n8n/OpenRouter-style API paths. ## ⚠️ Migrating a 4.6 call? Four things break or shift first 1. **Sampling params now 400-error.** Setting `temperature`, `top_p`, or `top_k` to any non-default value returns a **400** on Sonnet 5 (new for Sonnet-class). **Remove them.** For tone/variety, steer via the system prompt instead (see design section for the variety pattern). Audit any n8n HTTP nodes / API wrappers — a hardcoded `temperature` there will now fail the call. 2. **New tokenizer ≈ +30% tokens for the same text.** `max_tokens` limits tuned for 4.6 can now truncate equivalent output. **Raise `max_tokens`.** Exact inflation depends on content. 3. **Manual extended thinking is removed.** `thinking: {type:"enabled", budget_tokens:N}` returns a **400** (deprecated on 4.6, gone now). Use **adaptive thinking + the effort parameter** instead. 4. **Adaptive thinking is ON by default.** A request w