Claude Code Can Now Block a Model Switch and Price the Cache You Are About to Lose
Two new hook events turn silent model escalation into a decision you approve, and make "resume or start fresh" a priced choice instead of a guess.
Two new hook events turn silent model escalation into a decision you approve, and make "resume or start fresh" a priced choice instead of a guess. What happened Anthropic shipped Claude Code v2.1.251 on 28 August 2026. Four things in it change how an operator governs an agentic coding session. Model-switch hooks. The release adds PreModelSwitch and PostModelSwitch events, described in Anthropic's changelog as hooks that can "block, confirm, or annotate a model switch". A PreModelSwitch script that exits with code 2 blocks the switch. An agent can no longer quietly climb to a frontier tier mid-task. A price on the resume decision. SessionStart resume hooks now receive session staleness and the estimated re-cache cost. ⚠️ The changelog does not say what unit that cost is in — tokens, dollars, or a relative score — so treat it as ordinal until Anthropic documents it. Live spend and cache visibility. /usage gains a spend limit bar plus a rate limits.spend limit status line field for developers behind a Claude apps gateway, and /cost gains a per-session prompt-cache line reporting hit ratio, misses, tokens re-cached and warm/cold state. A path-traversal fix. The changelog states, verbatim: "Fixed file tools (Read, Write, Edit) following a symlink swapped inside the working directory after the permission check, which could read or write outside the approved location." The same release documents attach , logs , stop , respawn and rm in claude --help . Elsewhere in the v2.1.x series — Anthropic's changelog does not pin these to a single release — sit restricted mode ( --restricted ), cross-session messaging ( SendMessage / ListAgents ) and Enterprise usage credits ( /usage-credits ). Why it matters The money in an agentic coding session leaks in two places, and until this week neither was instrumented at the moment of decision. The first is tier escalation. On Anthropic's published pricing, Opus 4 costs $15 per million input tokens against Sonnet 4's $3 — 5× on input and 5× on output. By our own arithmetic, a 100k-input / 10k-output turn is roughly $0.45 on Sonnet and $2.25 on Opus. A hundred silently escalated tasks a day is around $180 a day nobody approved. PreModelSwitch is the first vendor-supplied place to stop that before the tokens flow. The second is cache churn. Anthropic's caching docs price a cache write at 1.25× base input and a cache read at 0.1×, with a 5-minute default TTL. On our arithmetic, a warm 100k-token prompt costs about $0.03 to read versus $0.30 cold, and the write pays for itself after two hit turns. Session design — how long you keep a session alive, how volatile your prompts are — is therefore a margin decision, and /cost now shows you which side of it you are on. We wrote about this on 29 July , arguing that model routing only becomes governance when operators get runtime intervention points rather than post-hoc dashboards: Model Routing Playbook. That call held — PreModelSwitch is exactly that intervention point, now first-