-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Open
Labels
area:autharea:idebugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already existsplatform:linuxIssue specifically occurs on LinuxIssue specifically occurs on Linuxplatform:vscodeIssue specifically occurs in VS CodeIssue specifically occurs in VS Code
Description
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:{ "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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:autharea:idebugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already existsplatform:linuxIssue specifically occurs on LinuxIssue specifically occurs on Linuxplatform:vscodeIssue specifically occurs in VS CodeIssue specifically occurs in VS Code