Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.251 ·

The /model menu and SDK flag changes wait on PreModelSwitch hooks

Model and effort changes from the picker now run hooks first and can be cancelled.

Use it now New Features
JSON All of v2.1.251
Use it nowTier: how much it should matter to you
3Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
HooksArea: what it touches
New FeaturesKind: in v2.1.251,
What probably matters to youSection of the release
What

Changing model or effort level from the /model menu now runs hooks first, showing a "Running PreModelSwitch hooks…" spinner. A block decision cancels the switch and shows the hook's reason; ask sends you to the confirmation dialog with that reason as the prompt. Any system messages the hook returns are appended to the resulting notice.

Details
  • The same pass runs when an SDK client changes model or agent through apply_flag_settings; anything other than proceed blocks the switch and reports back over the control channel.
  • If the session's model changes while the hooks are still running, the request is rejected with "agent switch not applied: the session's model changed while PreModelSwitch hooks ran; send the request again".
  • Only has an effect if a PreModelSwitch hook is configured.
Evidence

Running PreModelSwitch hooks…, agent switch not applied: the session's model changed while PreModelSwitch hooks ran; send the request again

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

Read from
Names in the bundle/model
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Confirmed since Anthropic's documentation has since written up /model, on All settings. Cap the [effort level](/docs/en/model-config#adjust-effort-level) a session can use, leaving lower levels available. Any higher level runs at the cap instead, including one from `/effort`, the `/model` picker, `--effort`, [`CLAUDE_CODE_EFF… settings-reference see the edit
Added since A small documentation edit on Agent SDK reference - TypeScript touched a line naming /model after this was published. `effortLevel` accepts an [effort level](/docs/en/model-config#adjust-effort-level) name. It also accepts `"ultracode"`, which requests `xhigh` effort with [ultracode](/docs/en/workflows#let-claude-decide-with-ultracode) on. `applyFlagSetti… agent-sdk/typescript see the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agreesA small documentation edit on Agent SDK reference - TypeScript touched a line naming /model after this was published.
Anthropic's release notes agreeAdded PreModelSwitch and PostModelSwitch hook events (block, confirm, or annotate a model switch); SessionStart resume hooks now receive…

See this entry in the whole of v2.1.251 →

Feedback