Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.251 Home All releases olderv2.1.250
Claude Code v2.1.251

/model switches can be blocked or held for confirmation by a hook

Use it now
Useful4 Signal4
Hooks Notable

A PreModelSwitch hook can block or hold your /model change for confirmation.

/modelPreModelSwitch
What

Running /model with a model name now consults any registered model-switch hooks before the model changes. A hook can block the switch outright, in which case you see "model switch blocked by a PreModelSwitch hook" and are told to run /model to confirm, or it can answer "ask", which leaves the model unchanged and directs you to /model interactively. Hooks can also attach their own messages to the confirmation, so a switch that needs a second look explains why instead of failing silently.

Details
  • Only engaged when model-switch hooks are registered by the caller; with none registered, switching behaves exactly as before.
  • A hook answering "ask" changes nothing and defers to the interactive /model picker.
  • The check on whether a model is available now gives up and reports "Couldn't confirm model '" rather than hanging indefinitely when it stalls.
Evidence

Couldn't confirm model ', model switch blocked by a PreModelSwitch hook

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

Related

Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.

See this entry in the whole of v2.1.251 →