Follow Discord
Sweep 06 Nov 2026 · 01:32Z Build v2.1.319 537 read Stable v2.1.311 Latest v2.1.318 Next v2.1.319 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.296 ·

set_model gains an only_if_model_is_current guard for swapping the system prompt

SDK set_model requests can swap the system prompt only if a named model is running, failing with model_not_current otherwise; Remote Control refuses it

Group of 3 Use it now Improvements
JSON All of v2.1.296
Use it nowTier: how much it should matter to you
5Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
Remote ControlArea: what it touches
ImprovementsKind: in v2.1.296,
What probably matters to youSection of the release

What

Programs that drive Claude Code through the SDK (the software development kit for building on top of Claude Code) can send a set_model request to change the model. That request now accepts an optional true-or-false field, only_if_model_is_current.

  • When only_if_model_is_current is true, the request does not switch models. model must name a specific model, and system_prompt is required.
  • If the session confirms it is running the named model, system_prompt replaces the session's custom system prompt.
  • If the session cannot confirm that, the request fails with the new error code model_not_current and changes nothing.
  • The field is marked internal and is documented as supported by claude -p and by claude-code-server workers.
  • Remote Control, which lets you drive a session from another device, refuses the field with the error "set_model: Remote Control does not implement only_if_model_is_current. The request changed nothing." Before, Remote Control ignored it.

The same release also changes how a remote cloud session is created. The request no longer sends a builtinTools field, an environment check now runs before launch, and branch-name generation is skipped when builtinTools is not empty.

Why

A program can now replace the system prompt only while a known model is running, so a model change happening at the same moment cannot leave the wrong prompt on the wrong model. When the condition is not met, nothing changes and the error code says why. Programs talking to Remote Control get an explicit error instead of having the field silently ignored.

Read from
Names in the bundleset_modelonly_if_model_is_current
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.

Added since A small documentation edit on Agent SDK reference - Python touched a line naming set_model after this was published. | `set_model(model)` | Change the model for the current session. Pass `None` to reset to [Claude Code's default model](/docs/en/model-config). A session in `auto` mode [changes to `default` mode](/docs/en/agent-sdk/permissions#auto-mode-au… agent-sdk/python see the edit
Confirmed since Anthropic's documentation has since written up set_model, on Configure permissions. If you switch a session that's in auto mode to a model that auto mode doesn't support, using [`set_model()`](/docs/en/agent-sdk/python#claudesdkclient), [`setModel()`](/docs/en/agent-sdk/typescript#query-object), or [`applyFlagSettings()`]… agent-sdk/permissions see the edit
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up set_model, on Configure permissions.

See this entry in the whole of v2.1.296 →

Feedback