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.json with:

``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 status correctly shows different accounts per workspace ✅
  • VSCode extension shows the wrong account for one workspace, and /usage reports 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

  1. Set up two VSCode workspaces with different Claude accounts using CLAUDE_CONFIG_DIR
  2. claude auth login in each workspace's terminal — confirm different accounts via claude auth status
  3. Open Claude Code via the VSCode extension in both workspaces
  4. Compare /usage output — both show identical numbers
  5. 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

View original on GitHub ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗