[BUG] VS Code extension: model switching broken since 2.1.86

Status Fixed / completed
Reported on v2.1.87
Maintainer reply None cached
Activity 9 comments · opened Mar 29, 2026 · closed Apr 17, 2026

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?

The VS Code extension does not respond to /model opus command and there is no way to switch to Opus model from the extension UI. The CLI version works fine and switches to Opus successfully, but the extension always uses Sonnet 4.5 regardless of settings.

Timeline:

  • Extension version 2.1.87 was released ~2 hours ago
  • This appears to be a regression - model switching may have broken in recent releases

What I tried:

  1. /model opus command in VS Code extension chat → no response, command appears to be ignored
  2. Added "claudeCode.selectedModel": "opus" to settings.json → no effect, still Sonnet 4.5
  3. Added "claudeCode.selectedModel": "claude-opus-4-6" → no effect
  4. Added "claudeCode.selectedModel": "opus[1m]" (from issue #35789 workaround) → no effect
  5. Reloaded VS Code window multiple times
  6. CLI /model opus → works perfectly, switches to Opus

Current state:

  • CLI: model switching works ✅
  • VS Code extension: /model command not available, settings don't work ❌
  • Extension always uses claude-sonnet-4-5-20250929 regardless of settings

What Should Happen?

  1. /model opus command should work in VS Code extension (same as CLI)
  2. OR there should be a UI control to switch models
  3. OR claudeCode.selectedModel setting should actually work

Model switching should be consistent between CLI and VS Code extension.

Error Messages/Logs

No error messages - /model opus command is silently ignored in VS Code extension.

Steps to Reproduce

  1. Open Claude Code extension in VS Code (version 2.1.87)
  2. Type /model opus in chat
  3. Observe that command is ignored (no response, no error)
  4. Try adding "claudeCode.selectedModel": "opus[1m]" to VS Code settings.json
  5. Reload window
  6. Ask Claude which model it's using → still Sonnet 4.5

Compare with CLI:

  1. Run claude in terminal
  2. Type /model opus
  3. Model switches to Opus successfully ✅

Claude Model

Sonnet (default) - cannot switch to Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown - possibly before 2.1.87

Claude Code Version

2.1.87 (VS Code extension)

Platform

Anthropic API

Operating System

macOS Darwin 25.0.0

Terminal/Shell

VS Code integrated terminal

Additional Information

Related issues:

  • #38331 - opposite problem (switches to Sonnet, gets Opus)
  • #35789 - Default shows Opus but sets Sonnet (workaround doesn't help in 2.1.87)
  • #33865 - VS Code extension ignores project-level model setting

The claudeCode.selectedModel setting is not documented in the extension's package.json configuration schema, which may explain why it's not working.

View original on GitHub ↗

9 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/35789
  2. https://github.com/anthropics/claude-code/issues/38331
  3. https://github.com/anthropics/claude-code/issues/36047

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

LDD19 · 5 months ago

I'm getting Unknown Configuration Setting for "claudeCode.selectedModel": "claude-opus-4-5-20251101"

For some reason it automatically switched me to Sonnet 4.6 a few days ago. It's been a frustrating few days.

malinindev · 5 months ago

Why is this still not fixed? This problem is definitely not related to vs code (I tried it in several versions).
There is no issue in version 2.1.85. The bug is reproducible starting from 2.1.86

There is no workaround except downgrading to an older version.
Does anybody at Anthropic actually use this extension?

https://github.com/user-attachments/assets/2c77e7f0-92c7-4760-b64b-56d8ff54136e

XhstormR · 5 months ago

+1, vscode shows this is unknown settings: "claudeCode.selectedModel"

Jerware · 5 months ago

When I select the Default model in VS Code (listed as Opus 4.6 with 1M context), it switches me to claude-haiku-4-5-20251001. I cannot access opus[1m] in VS Code at all unless I downgrade the extension to 2.1.85.

Claude Code command line works fine in any version. Please fix!

LDD19 · 5 months ago
When I select the Default model in VS Code (listed as Opus 4.6 with 1M context), it switches me to claude-haiku-4-5-20251001. I cannot access opus[1m] in VS Code at all unless I downgrade the extension to 2.1.85. Claude Code command line works fine in any version. Please fix!

Downgrading the version fixed the issue for me.

Jerware · 4 months ago

Still busted as of 2.1.109. Just to test I upgraded the extension, restarted VS Code, and I get the same problem. Using "Switch model..." I see:

Default (recommended)
Opus 4.6 with 1M context

Sonnet
Sonnet 4.6

Haiku
Haiku 4.6

Choosing Sonnet works fine, but choosing EITHER ONE of the other options switches to Haiku. In fact, they appear to be the same alias because if I choose Haiku and then choose Default (Opus 4.6), I don't get any kind of message. It's only if I'm on Sonnet and then select one of the others that I get the following:

~~~ Switched to claude-haiku-4-5 20251001 ~~~

Guess I'm reverting back to 2.1.85 again.

P.S. One note, after reverting back to 2.1.85 and switching to Opus 4.6 (which works) the model name has a redundant [1m] in it. Don't know if this is related.

~~~ Switched to claude-opus-4-6[1m][1m] ~~~

malinindev · 4 months ago

Solved it. Posting in case someone has the same problem.

The reason was the ANTHROPIC_MODEL environment variable in my ~/.zshrc. I added it a long time ago and forgot about it:

export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"

This variable forces the extension to use Sonnet 4.5 every time it starts, and it overrides only the default model you pick in the UI. That's why:

  • Picking a different model in the UI seemed to work, but the next message was back to Sonnet 4.5.
  • The claudeCode.selectedModel setting did nothing.
  • The problem did not go away after a full reinstall of VS Code and the extension.
  • My other Mac worked fine - it just didn't have this line in .zshrc.

How to fix it:

  1. Check if the variable is set:

``bash
env | grep ANTHROPIC_MODEL
grep ANTHROPIC_MODEL ~/.zshrc ~/.bashrc ~/.zshenv ~/.profile 2>/dev/null
``

  1. If you find it, remove the export ANTHROPIC_MODEL=... line and fully restart VS Code (Cmd+Q, not just close the window).

A small request to the Claude Code team: it would be great if the extension showed a warning when ANTHROPIC_MODEL is overriding the selected model, or if the UI picker had priority over the variable. Right now the model picker silently does nothing because of a variable you set months ago - it's very hard to debug.

I spent hours deleting VS Code, Cursor, Keychain entries, configs, and caches before I found this one line.

Hope this helps someone

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.