[BUG] VSCode extension ignores ANTHROPIC_MODEL environment variable when using Bedrock

Status Open
Reported on v2.1.11
Maintainer reply None cached
Activity 13 comments · opened Jan 18, 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?

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_

View original on GitHub ↗

13 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/16982
  2. https://github.com/anthropics/claude-code/issues/17760
  3. https://github.com/anthropics/claude-code/issues/18025

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

elsegev · 7 months ago

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.

Will-So · 7 months ago

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:

  1. Updating it in settings

<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" />

  1. Updating it in Environmental variables

<img width="331" height="144" alt="Image" src="https://github.com/user-attachments/assets/da144da5-088e-421e-8df3-c0a68db79143" />

  1. Uninstalling and reinstalling Claude code extension
  2. Double checking settings.json
  3. Confirming that the correct model is used in the CLI (it does, Opus 4.5)
prrtzt · 7 months ago

Same here

jvanwinkle · 7 months ago

Same here

wjdunlop · 7 months ago

SAme here

momchil-mitev · 7 months ago

same here

toddvirgil · 7 months ago

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 of us., the GUI mode's failure to read ANTHROPIC_MODEL results in a hard API error:

API Error (us.anthropic.claude-sonnet-4-5-20250929-v1:0): 400 The provided model identifier is invalid.

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": true in .vscode/settings.json - terminal mode correctly inherits environment variables via direnv.

fwf-ben · 6 months ago

Yeah hit this even with updates to ~/.claude/settings.json

ewferg · 6 months ago

I am also seeing this problem. Terminal mode works, but it isn't my preference

ccmcbeck · 6 months ago

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 extension 2.1.49 stubbornly falls back to 4.5.

FWIW, I tried rm -rf ~/.vscode/globalStorage/anthropic.claude-code to no avail

ccmcbeck · 6 months ago

Upon closer review, I was able to fix the issue using these ~/.claude/settings.json ENV vars

"env": {
    "ANTHROPIC_MODEL": "global.anthropic.claude-sonnet-4-6",
    "ANTHROPIC_SMALL_FAST_MODEL": "global.anthropic.claude-haiku-4-5-20251001-v1:0",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "global.anthropic.claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "global.anthropic.claude-haiku-4-5-20251001-v1:0",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "global.anthropic.claude-opus-4-6-v1",
    "AWS_PROFILE": "**REDACTED**",
    "AWS_REGION": "us-east-1",
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "8192"
  },
...

I am not sure what fixed it?

  1. Using global. for the model names
  2. Adding the ANTHROPIC_DEFAULT_* settings

But I tested it on Mac and Windows and now it's using 4.6 instead of silently defaulting to 4.5 so my guess is that if there is some syntax issue with the ANTHROPIC_* ENV vars, the extension just reverts to a known default.

waynehuu · 5 months ago

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.