[BUG] VS Code sidebar model badge shows Haiku while /model reports Sonnet 5, blocking Auto mode
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
In the VS Code extension sidebar (native UI, not terminal mode), opening a new session shows "Haiku" in the model selector badge/dropdown, even though the session's actual active model is Sonnet 5. This mismatch causes Auto mode to be unavailable/greyed out (Auto mode requires Sonnet/Opus tier).
Environment
- Extension: anthropic.claude-code 2.1.220 (linux-x64)
- Connection: VS Code Remote-SSH
- Model set via:
claudeCode.environmentVariablesin Remote Machine settings.json →ANTHROPIC_MODEL=claude-sonnet-5
Steps to reproduce
- Set
claudeCode.environmentVariablesto[{"name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5"}]in the Remote-SSH Machine settings.json. - Reload the VS Code window.
- Open a new Claude Code session in the sidebar.
- Observe the model badge/dropdown shows "Haiku".
- Run
/modelin that same session.
Expected behavior
The model badge should match what /model reports, and Auto mode should be available since the active model is Sonnet 5.
Actual behavior
- Model badge/dropdown: shows "Haiku"
/modeloutput:Current model: Sonnet 5 (effort: high)- Auto mode option is not selectable, presumably because the UI's (incorrect) badge state says Haiku.
Additional notes
- No
claudeCode.defaultModelsetting exists in the extension's contributed configuration (checked package.json for v2.1.220) — onlyclaudeCode.environmentVariablesis available to influence model at launch. - Confirmed via
env | grep ANTHROPIC_MODELthat the correct env var reaches the spawned process. - This appears distinct from #43235/#42648 (Auto mode disabled because the model really is Haiku) and #36478 (model config not loading, closed as not planned) — here the backend model is confirmed correct, only the UI badge/Auto-mode gating is out of sync.
What Should Happen?
The model badge/dropdown in the sidebar should reflect the session's actual active model. Since ANTHROPIC_MODEL=claude-sonnet-5 is set and /model confirms "Current model: Sonnet 5 (effort: high)", the badge should show "Sonnet 5", not "Haiku" — and Auto mode should be selectable, since Auto mode is supported on Sonnet 5.
Error Messages/Logs
Steps to Reproduce
- In VS Code Remote-SSH, set the following in the Machine settings.json:
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5" }
]
- Reload the VS Code window (Developer: Reload Window).
- Open a new Claude Code session (New session) in the sidebar.
- Observe that the model badge/dropdown shows "Haiku".
- Run /model in that same session.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.220
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
_No response_