[FEATURE] Support per-VS Code session/profile authentication (multi-user shared OS account)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
On shared machines where multiple users operate under a single OS account (common in labs, research environments, and enterprise servers), Claude Code stores credentials in a single global file at ~/.claude/credentials.json. This means whoever authenticates first shares their Claude account with every other VS Code session on the machine — other users are billed against that account, have access to that user's subscription tier, and there is no way to distinguish sessions. There is no prompt to re-authenticate per session, and no warning that you are using someone else's account.
GitHub Copilot does not have this problem because it uses VS Code's built-in authentication provider API, which is profile and session aware.
Proposed Solution
Integrate with VS Code's native authentication provider API (vscode.authentication). This is the same mechanism Copilot uses. It allows credentials to be scoped per VS Code profile so each user authenticating within their own VS Code window gets an independent session, even on a shared OS account.
Alternative Solutions
Respect ANTHROPIC_API_KEY per session — already works, but forces users onto API keys rather than account login and requires manual setup per launch.
VS Code profile-aware credential paths — store credentials at a path derived from the active VS Code profile ID rather than a fixed ~/.claude/ path, so different profiles have isolated credentials without requiring full auth API integration.
Warn on shared credential use — at minimum, detect when a second VS Code window connects and warn the user that another session is already authenticated under a different identity, prompting re-authentication.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
_No response_
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗