VSCode extension ignores per-workspace auth when using CLAUDE_CONFIG_DIR
Resolved 💬 9 comments Opened Mar 16, 2026 by ithiria894 Closed May 5, 2026
Bug Description
When using CLAUDE_CONFIG_DIR environment variable in VSCode workspace settings to separate Claude Code accounts across different workspaces, the VSCode extension does not respect the per-workspace auth and always uses the same account, even though the terminal CLI correctly uses the correct account.
Setup
- Two VSCode workspaces, each intended to use a different Claude account
- Workspace A (work): has
.vscode/settings.jsonwith:
``json``
{
"claudeCode.environmentVariables": [
{
"name": "CLAUDE_CONFIG_DIR",
"value": "/home/user/.claude-work"
}
]
}
- Workspace B (personal): uses default
~/.claude/config dir
Expected Behavior
- Workspace A extension → uses work account (e.g.
work@company.com) - Workspace B extension → uses personal account (e.g.
personal@gmail.com)
Actual Behavior
- Terminal
claude auth statuscorrectly shows different accounts per workspace ✅ - VSCode extension shows the wrong account for one workspace, and
/usagereports identical usage numbers (40% / 1%) for both ❌ - Verified on claude.ai website: personal account shows 0% usage, confirming the extension was routing all API calls through the work account despite displaying the personal account name
- The extension's Account & Usage panel displays the personal account info (email, org name), but the underlying API calls go through the work account's token
Steps to Reproduce
- Set up two VSCode workspaces with different Claude accounts using
CLAUDE_CONFIG_DIR claude auth loginin each workspace's terminal — confirm different accounts viaclaude auth status- Open Claude Code via the VSCode extension in both workspaces
- Compare
/usageoutput — both show identical numbers - Verify on claude.ai website — only one account has actual usage
Environment
- Claude Code v2.1.76
- VSCode on Linux (Ubuntu)
- Both accounts on Claude Team plan
- Auth method: claude.ai OAuth
Impact
- Users who set up multi-account separation believe their personal usage is on their personal account, but it's actually being billed to their work account
- The extension UI displays misleading account information, showing one account while using another's credentials
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗