[BUG] New VS Code Extension does not recognize ANTHROPIC_BASE_URL and shows login screen
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?
My company uses Claude Code with an LLM behind LiteLLM. To make that work we set ANTHROPIC_BASE_URL to our LiteLLM url. We do this in /etc/claude-code/managed-settings.json, like so:
"env": {
"ANTHROPIC_BASE_URL": "<URL>",
...
}
With the new VS Code Extension (since at least 2.0.0), it just immediately shows us an anthropic login screen. There is no clear way to force it to use a different LLM backend.
Consequently the new VS Code Extension is completely broken for us.
What Should Happen?
We can use the new VS Code extension with a custom ANTHROPIC_BASE_URL
Error Messages/Logs
Steps to Reproduce
- Set the ANTHROPIC_BASE_URL env var to a dummy value in ~/claude/settings.json as above
- Open the new VS Code extension
- Instead of trying to connect to the ANTHROPIC_BASE_URL, the extension always shows an anthropic login screen.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.127
Claude Code Version
2.0.1
Platform
AWS Bedrock via LiteLLM
Operating System
macOS
Terminal/Shell
VS Code Extension
Additional Information
No response
See some other reports in this reddit thread: https://www.reddit.com/r/ClaudeAI/comments/1ntt821/how_to_specify_anthropic_base_url_for_vscode/
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/8500
- https://github.com/anthropics/claude-code/issues/8400
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
Investigating now - we should be respecting the managed settings!
In the meantime, FYI you can still access the old extension by running claude in the built-in terminal (or the external terminal and using the /ide command)
@hackyon-anthropic thanks! FWIW, I tried moving my managed-settings.json to <repo root>/.claude/settings.json, but the extension still showed a login screen.
@nadzinski i guess current workaround is to stick to 1.0.127 ?
You can continue to run claude in the built-in terminal (or an external terminal) to use the terminal with old IDE integration!
Same issue, when using Claude Code via AWS Bedrock
I'm facing the same issue when connecting the Claude Code for VS Code extension (v2.0.0) to a litellm proxy.
@nadzinski i guess current workaround is to stick to 1.0.127 ?
@y-nk yes; we have pinned everyone here to 1.0.127 of the VS Code extension for now until this is fixed. Although like @hackyon-anthropic says, it does work if you run claude in the terminal, but most developers at our company are used to launching with the Claude icon, so pinning to the older version seemed like the best option.
To disable the login screen of the extension, you should be able to set CLAUDE_CODE_SKIP_AUTH_LOGIN to true in the env variables (most likely in the VSCode extension env variables).
To disable the login screen of the extension, you should be able to set
CLAUDE_CODE_SKIP_AUTH_LOGINtotruein the env variables (most likely in the VSCode extension env variables).
@blois Not sure I'm doing this right, but I get the same JSON error loop.
Claude Code v2 no longer appears to load environment variables from settings.json. As a workaround, you can manually export them in your shell configuration (e.g., .zshrc):
echo 'export ANTHROPIC_AUTH_TOKEN="xxx" ANTHROPIC_BASE_URL="xxx"' >> ~/.zshrc
Then reload your shell to apply the changes:
source ~/.zshrc
@micaelmalta my setup is with env vars since the beginning. bug still appears regardless with latest 2.0.9. last i tested was about 2hrs ago
for people using bedrock with env vars:
- add
export CLAUDE_CODE_SKIP_AUTH_LOGIN=trueto whatever you're loading (.zshrc, etc) - open vscode
- change the model with the Select Model command
now it'd be nice if the model selected was respecting ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL env vars.
@micaelmalta - Claude Code should still be respecting env variables from settings.json.
As a test, I just added to settings.json:
"env": {
"TESTING_KEY": "a secret value: 12345"
}
Then had the model echo it: echo the value of the env variable "TESTING_KEY". I've seen a few reports that these env variables are not respected but we have not been able to repro it ourselves.
Although this bug is still open, I tried with the newest v2.0.10 and it now works (fixed?), at least for the specific ANTHROPIC_BASE_URL config for which I initially reported the bug. I now longer see a login screen. Anyone else having success with the new version?
@nadzinski i do not see the logic screen any more, when configuring settings from settings.json how ever nothing works, im stuck on the "thinking" animation (CLI works ofc)
To disable the login screen of the extension, you should be able to set
CLAUDE_CODE_SKIP_AUTH_LOGINtotruein the env variables (most likely in the VSCode extension env variables).@blois Not sure I'm doing this right, but I get the same JSON error loop.
![]()
This way of setting the env var worked for me, it skipped the login screen and is working with the ANTHROPIC_BASE_URL.
This appears to be fixed in 2.0.21.
I had to restart VSCode to get this working.
Maybe I'm doing something wrong, but even on 2.0.26, my ~/.claude/settings.json seems to be ignored.
I’m seeing the similar behavior on 2.0.31 and have opened #11027.
From what I can tell, CLAUDE_CODE_USE_BEDROCK isn’t being read from <project_root>/.claude/settings.json. Both issues appear to have the same root cause: VS Code extension ignoring settings.json when deciding whether or not to display the sign-in screen.
I was getting lots of "API Error: 404 no Route matched with those values" in the new extension. What worked for me was explicitly setting the model with "claudeCode.selectedModel": "claude-sonnet-4" instead of setting it via the ANTHROPIC_MODEL environment variable; it seems like that one is ignored by the new extension.
If it doesn't work to set the environment variables like this:
"claudeCode.environmentVariables": [
{"name": "ANTHROPIC_BEDROCK_BASE_URL", "value": "xxxx"},
{"name": "AWS_BEARER_TOKEN_BEDROCK", "value": "xxxx"},
{"name": "CLAUDE_CODE_USE_BEDROCK", "value": "1"},
{"name": "DISABLE_TELEMETRY", "value": "1"},
],
Then you can also set your environment variables on your system, for instance in Windows via your user's system-wide env variables. In that case you need to restart VS Code process so that the claude process can see the changes.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
still persisting
