[BUG] VS Code extension ignores third-party provider environment variables during authentication check

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Nov 25, 2025 · closed Feb 7, 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?

The AuthManager checks for authentication before reading environment variables from .claude/settings.json or claudeCode.environmentVariables. When using Microsoft Foundry with CLAUDE_CODE_USE_FOUNDRY=1 and related variables, the extension still prompts for login. The terminal version works correctly with the same configuration.

What Should Happen?

Extension should check for third-party provider environment variables before requiring authentication

Error Messages/Logs

Extension reports "No authentication found" and blocks usage

Steps to Reproduce

Create setting in the .claude/settings.json
{
"env": {
"CLAUDE_CODE_USE_FOUNDRY": "1",
"CLAUDE_CODE_SKIP_AUTH_LOGIN": "1",
"ANTHROPIC_FOUNDRY_RESOURCE": "xxxx",
"ANTHROPIC_FOUNDRY_API_KEY": "yyyyy",
"ANTHROPIC_DEFAULT_SONNET_MODEL":"claude-sonnet-4-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL":"claude-haiku-4-5"
}
}
Launch the extension

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

extension version 2.0.53

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

This works if you launch vs code with a script:

#!/bin/bash
export CLAUDE_CODE_USE_FOUNDRY=1
export CLAUDE_CODE_SKIP_AUTH_LOGIN=1
export ANTHROPIC_FOUNDRY_RESOURCE=xxxx
export ANTHROPIC_FOUNDRY_API_KEY=yyyy
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5

code "$@"
EOF

View original on GitHub ↗

12 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/11937
  2. https://github.com/anthropics/claude-code/issues/9136
  3. https://github.com/anthropics/claude-code/issues/11027

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

sheldonhull · 9 months ago

Might be related, as I know the #11937 post I shared, indicated I got it working with CLI locally, but not in Azure Pipelines/CI, so following in case there's some related issue that in different tooling or environment is causing it to fail.

Gui-FernandesBR · 9 months ago

hello, any updates on this?

akdavidsson · 9 months ago

Agree, any updates on this? I have spent a whole lot of time trying to get this work, but I am starting to think this isn't actually a feature anymore.

ejfn · 8 months ago

At least the selected model id should be clearly displayed somewhere like what it does in CLI, currently it's very confused which one is selected. I have to ask the model who you are.

github-actions[bot] · 7 months ago

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.

Gui-FernandesBR · 7 months ago

I left claude extension.

I'm now using GPT codex extension instead.

The bug is probably still happening.

The idea was to use anthropic/vertex API in the claude extension, however, the setup gas never worked.

github-actions[bot] · 6 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 6 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

homerokzam · 6 months ago

Even though this issue was closed as “not planned”, is there any chance this behavior could be revisited in the future roadmap?

This problem still seems to affect users in similar scenarios, and it would be helpful to know whether a fix or redesign is explicitly out of scope or just not prioritized at the moment.

Any clarification on long-term plans would be greatly appreciated.

homerokzam · 6 months ago

Configuration Guide: Using Ollama Local Models with Claude Code VSCode Extension

Summary

This issue documents the working configuration for using Ollama-hosted local models with the Claude Code VSCode Extension, addressing the setup challenges reported in #20271 and #12361.

Working Configuration

To use Ollama local models, split the configuration between two files:

1. .vscode/settings.json - Model Selection

{
  "claudeCode.selectedModel": "kimi-k2.5:cloud"
}

2. .claude/settings.local.json - Ollama Environment

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "ollama",
    "ANTHROPIC_API_KEY": "",
    "ANTHROPIC_MODEL": "kimi-k2.5:latest",
    "ANTHROPIC_BASE_URL": "http://localhost:11434"
  }
}

Prerequisites

  1. Ollama installed and running:

``bash
ollama serve
``

  1. Model pulled:

``bash
ollama pull kimi-k2.5:latest
``

  1. Verify Ollama API is accessible:

``bash
curl http://localhost:11434/api/tags
``

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.