[BUG] VS Code extension ignores third-party provider environment variables during authentication check
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
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗