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_currentis true, the request does not switch models.modelmust name a specific model, andsystem_promptis required. - If the session confirms it is running the named model,
system_promptreplaces the session's custom system prompt. - If the session cannot confirm that, the request fails with the new error code
model_not_currentand changes nothing. - The field is marked internal and is documented as supported by
claude -pand 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.