claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] New VS Code Extension does not recognize ANTHROPIC_BASE_URL and shows login screen

Open nadzinski opened this issue 4 months ago • 24 comments

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

  1. Set the ANTHROPIC_BASE_URL env var to a dummy value in ~/claude/settings.json as above
  2. Open the new VS Code extension
  3. 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

nadzinski avatar Sep 30 '25 20:09 nadzinski

See some other reports in this reddit thread: https://www.reddit.com/r/ClaudeAI/comments/1ntt821/how_to_specify_anthropic_base_url_for_vscode/

nadzinski avatar Sep 30 '25 20:09 nadzinski

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8500
  2. 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

github-actions[bot] avatar Sep 30 '25 20:09 github-actions[bot]

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 avatar Oct 01 '25 00:10 hackyon-anthropic

@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 avatar Oct 01 '25 04:10 nadzinski

@nadzinski i guess current workaround is to stick to 1.0.127 ?

y-nk avatar Oct 01 '25 06:10 y-nk

You can continue to run claude in the built-in terminal (or an external terminal) to use the terminal with old IDE integration!

hackyon-anthropic avatar Oct 01 '25 07:10 hackyon-anthropic

Same issue, when using Claude Code via AWS Bedrock

Image

gaiar avatar Oct 01 '25 07:10 gaiar

I'm facing the same issue when connecting the Claude Code for VS Code extension (v2.0.0) to a litellm proxy.

Brolywood avatar Oct 01 '25 12:10 Brolywood

@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.

nadzinski avatar Oct 01 '25 16:10 nadzinski

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).

blois avatar Oct 06 '25 16:10 blois

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).

@blois Not sure I'm doing this right, but I get the same JSON error loop.

Image Image

timfallmk avatar Oct 06 '25 22:10 timfallmk

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 avatar Oct 07 '25 00:10 micaelmalta

@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

y-nk avatar Oct 07 '25 07:10 y-nk

for people using bedrock with env vars:

  1. add export CLAUDE_CODE_SKIP_AUTH_LOGIN=true to whatever you're loading (.zshrc, etc)
  2. open vscode
  3. change the model with the Select Model command
Image

now it'd be nice if the model selected was respecting ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL env vars.

y-nk avatar Oct 07 '25 15:10 y-nk

@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.

blois avatar Oct 07 '25 16:10 blois

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 avatar Oct 08 '25 00:10 nadzinski

@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)

tomgabay avatar Oct 08 '25 07:10 tomgabay

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).

@blois Not sure I'm doing this right, but I get the same JSON error loop.

Image Image

Image

This way of setting the env var worked for me, it skipped the login screen and is working with the ANTHROPIC_BASE_URL.

shalevbell avatar Oct 08 '25 09:10 shalevbell

This appears to be fixed in 2.0.21. I had to restart VSCode to get this working.

lakshmikantdeshpande avatar Oct 17 '25 12:10 lakshmikantdeshpande

Maybe I'm doing something wrong, but even on 2.0.26, my ~/.claude/settings.json seems to be ignored.

Manouchehri avatar Oct 24 '25 13:10 Manouchehri

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.

nozaq avatar Nov 06 '25 23:11 nozaq

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.

Shanayara avatar Nov 17 '25 07:11 Shanayara

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.

github-actions[bot] avatar Dec 17 '25 10:12 github-actions[bot]

still persisting

jtatum avatar Dec 18 '25 22:12 jtatum