{"version":"2.1.275","anchor":"sdk-model-switching-gains-hook-gated-flow-with-gatewayplan","canonical_anchor":"sdk-model-switching-gains-hook-gated-flow-with-gatewayplan","heading":"SDK model switching gains hook-gated flow with gateway\/plan-mode side effects","tier":"internal","area":"SDK","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.275\/e\/sdk-model-switching-gains-hook-gated-flow-with-gatewayplan","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.275","markdown":"### SDK model switching gains hook-gated flow with gateway\/plan-mode side effects\n\nSDK-driven model switches now go through hook approval and can affect auto\/plan permission modes\n\n**What**\n\nWhen the SDK (the programmatic interface used to drive Claude Code) triggers a model switch, the handler for it now validates the target model, can short-circuit early via a bridge-print check, and routes the change through a hook-approval step, unless the session has no hooks pending, before applying it. Hooks are user-configured scripts that can approve, block, or modify actions. After the switch, the handler adjusts tool-permission context for sessions in 'auto' or 'plan' permission mode: it can deny the switch (recorded as `auto_gate_denied`) or update plan-mode context as appropriate.\n\n**Why**\n\nThis means a model switch requested via the SDK can now be intercepted by hooks and can be denied or adjusted based on the session's current permission mode, rather than always applying immediately.\n\n- Area: SDK\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5"}