[BUG] VSCode extension ignores ANTHROPIC_MODEL environment variable when using Bedrock
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?
When using Bedrock with the VSCode extension, the ANTHROPIC_MODEL environment variable is set correctly but ignored.
Configuration:
- claudeCode.environmentVariables in settings.json includes:
- CLAUDE_CODE_USE_BEDROCK=1
- AWS_REGION=us-east-1
- ANTHROPIC_MODEL=us.anthropic.claude-opus-4-5-20251101-v1:0
Verified:
- Environment variables are correctly set in the Claude Code process (confirmed via Bash tool)
- The Opus model is available and accessible in Bedrock us-east-1
- The extension always uses Sonnet 4.5 regardless of the ANTHROPIC_MODEL setting
Expected: Extension should use the model specified in ANTHROPIC_MODEL
Actual: Extension uses claude-sonnet-4-5-20250929 by default
VSCode version: [your version]
Claude Code extension version: 2.1.11 (from session logs)
What Should Happen?
Expected: Extension should use the model specified in ANTHROPIC_MODEL
Actual: Extension uses claude-sonnet-4-5-20250929 by default
Error Messages/Logs
Steps to Reproduce
Configure VSCode settings - Add to settings.json (User settings or Workspace settings):
{
"claudeCode.environmentVariables": [
{"name": "AWS_PROFILE", "value": "default"},
{"name": "CLAUDE_CODE_USE_BEDROCK", "value": "1"},
{"name": "AWS_REGION", "value": "us-east-1"},
{"name": "ANTHROPIC_MODEL", "value": "us.anthropic.claude-opus-4-5-20251101-v1:0"}
]
}
Verify model access - Confirm you have access to the Opus model in Bedrock:
aws bedrock get-inference-profile --region us-east-1 \
--inference-profile-identifier "us.anthropic.claude-opus-4-5-20251101-v1:0"
Should return status "ACTIVE"
Restart VSCode completely - Quit VSCode entirely (Cmd+Q on Mac) and reopen
Start a new Claude Code chat - Open a new chat session (not continuing an existing one)
Ask which model is running:
which model are you?
Verify environment variables are set - In the chat, run:
env | grep -E "(ANTHROPIC_MODEL|CLAUDE_CODE_USE_BEDROCK|AWS_REGION)"
Expected Result:
Claude should respond that it's Claude Opus 4.5 with model ID us.anthropic.claude-opus-4-5-20251101-v1:0
Actual Result:
Claude responds that it's Claude Sonnet 4.5 with model ID us.anthropic.claude-sonnet-4-5-20250929-v1:0
Environment variable shows ANTHROPIC_MODEL=us.anthropic.claude-opus-4-5-20251101-v1:0 (correctly set)
Extension is setting the env var but not using it for model selection
This confirms the VSCode extension reads and sets the environment variable but doesn't use it when initializing the model.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
It’s not the same because I can change it in the terminal. The issue is only in VS Code.
And I tested it using the Bedrock API key, not as a direct Claude user.
I am also having this issue:
<img width="344" height="452" alt="Image" src="https://github.com/user-attachments/assets/ac8333f3-e03b-4f6d-950a-5e7000790d49" />
I have tried:
<img width="416" height="115" alt="Image" src="https://github.com/user-attachments/assets/25d2a67e-5790-4454-93dc-7714a6f9a749" />
<img width="466" height="109" alt="Image" src="https://github.com/user-attachments/assets/933ecb10-829b-403a-93cf-5a549c815e5a" />
<img width="331" height="144" alt="Image" src="https://github.com/user-attachments/assets/da144da5-088e-421e-8df3-c0a68db79143" />
Same here
Same here
SAme here
same here
Same issue here, with an additional impact for GovCloud users:
Since GovCloud requires the
us-gov.model prefix (e.g.,us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0) instead ofus., the GUI mode's failure to readANTHROPIC_MODELresults in a hard API error:The extension tries to use the commercial prefix which doesn't exist in GovCloud, making the GUI completely unusable for GovCloud Bedrock users.
Workaround: Set
"claudeCode.useTerminal": truein.vscode/settings.json- terminal mode correctly inherits environment variables via direnv.Yeah hit this even with updates to ~/.claude/settings.json
I am also seeing this problem. Terminal mode works, but it isn't my preference
Seeing the same behavior when trying to use
us.anthropic.claude-sonnet-4-6, which was released on 2/17. It works in the Terminal, but the VSCode extension2.1.49stubbornly falls back to4.5.FWIW, I tried
rm -rf ~/.vscode/globalStorage/anthropic.claude-codeto no availUpon closer review, I was able to fix the issue using these
~/.claude/settings.jsonENV varsI am not sure what fixed it?
global.for the model namesANTHROPIC_DEFAULT_*settingsBut I tested it on Mac and Windows and now it's using
4.6instead of silently defaulting to4.5so my guess is that if there is some syntax issue with theANTHROPIC_*ENV vars, the extension just reverts to a known default.Same here, was able to work around by setting ARN in "Selected Model" field in Claude Code for VS Code extension settings, but one accident clicking on switch model will mess it up.