[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_
This issue has 13 comments on GitHub. Read the full discussion on GitHub ↗