{"version":"2.1.307","anchor":"model-switch-control-response-now-returns-the-resulting-mode","canonical_anchor":"model-switch-control-response-now-returns-the-resulting-mode","heading":"Changing the model from a program now reports the model that applies","tier":"notice","area":"Agents","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.307\/e\/model-switch-control-response-now-returns-the-resulting-mode","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.307","markdown":"### Changing the model from a program now reports the model that applies\n\nWhen a program changes Claude Code's model, the reply now names the model in use, and the wait message mentions the `PreModelSwitch` hook\n\n**What**\n\nPrograms that control Claude Code, such as apps built with the Agent SDK, can ask it to switch to a different model. The reply to that request used to say only that it succeeded. It now also includes the model that is in use. When the request fails, the error also includes the model.\n\nThe error shown when an earlier switch is still in progress has new wording. It now says that an earlier model change, a check with the API or a `PreModelSwitch` hook has not finished. A `PreModelSwitch` hook is a command you configure to run before a model switch is applied.\n\n**Why**\n\nA program can now see which model Claude Code actually ended up using, instead of assuming its request was applied as asked.\n\n- Area: Agents\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}