|
| Command | What it does |
|---|---|
Claude Accounts: Switch Account |
Pick a saved account and make it the live login. |
Claude Accounts: Save Current Account |
Save whoever is signed in right now. |
Claude Accounts: Add Account (Log In) |
Save the current account, run claude auth login, then save the new one. |
Claude Accounts: Rename Saved Account |
Change an account's name. |
Claude Accounts: Remove Saved Account |
Forget an account and delete its saved tokens. |
Claude Accounts: Show Status |
Show where the live login is, saved accounts, and claude auth status. |
Settings
| Setting | Default | What it does |
|---|---|---|
claudeAccounts.claudeConfigDir |
empty | Claude Code's config folder. Leave it empty to use CLAUDE_CONFIG_DIR, or ~/.claude when that is not set. |
claudeAccounts.keychainService |
empty | macOS only. The Keychain item Claude Code reads. Leave it empty to derive the name from the config folder. |
claudeAccounts.claudePath |
empty | Full path to the claude CLI. Leave it empty to search PATH, Homebrew, npm's global folder, and the native installer location. |
claudeAccounts.syncIntervalMinutes |
5 |
How often to save refreshed tokens for the active account. 0 turns the timer off. |
claudeAccounts.showStatusBar |
true |
Show the active account in the status bar. |
How it works
- The live login on macOS. Claude Code reads the Keychain item
Claude Code-credentialsfor your macOS user. WhenCLAUDE_CONFIG_DIRis set, it adds a suffix: the first 8 hex characters of the SHA-256 of that path. When the Keychain rejects a write, such as over SSH, Claude Code uses.credentials.jsonin its config folder instead, and so does the extension. - The live login on Linux and Windows. Claude Code reads
.credentials.jsonin~/.claude, or inCLAUDE_CONFIG_DIRwhen that is set. - Saved accounts on macOS. Each account's tokens get their own Keychain item, named
Claude Account Switcher-<id>, and~/.claude-accounts/profiles.jsonlists the accounts. Every editor on the Mac shares them. - Saved accounts on Linux and Windows. Tokens go in VS Code's secret storage, and
profiles.jsonsits in the extension's storage folder. Each editor keeps its own accounts. - Account details.
profiles.jsonholds names, emails, plans, and expiry dates. It never holds a token. - Switching. The saved login is copied over the live one, and that account becomes active.
- Refreshed tokens. Before every switch, every few minutes, and when VS Code closes, the live login is copied back into the active account.
An account left unused past its refresh token's expiry needs a fresh login. The switcher marks those accounts in the picker.
Privacy and security
- Saved tokens are always encrypted. macOS keeps them in the Keychain. On Linux and Windows, VS Code's secret storage encrypts them with the system's key store: DPAPI on Windows, and a keyring such as GNOME Keyring or KWallet on Linux.
- On Linux without a keyring, VS Code falls back to weaker storage and tells you so. Install a keyring to keep saved tokens properly encrypted.
- The live login on Linux and Windows is Claude Code's own
.credentials.json. The extension replaces it in a single step and keeps it readable by your user only, the same way Claude Code does. - On macOS, tokens reach the
securitytool through stdin, which keeps them out of the process list. Credentials longer than 4,032 characters use the hex argument form instead, the same way Claude Code does. profiles.jsonand its folder are readable by your user only.- Error messages and logs never include token material.
- The extension itself makes no network requests and collects no telemetry. It runs the
claudeCLI, and on macOS thesecuritytool, on your machine.
To report a vulnerability, see SECURITY.md.
FAQ
Do my conversations and settings carry over when I switch?
Yes. Every account shares the same ~/.claude. Only the login changes.
Do I need to restart Claude Code after switching?
Restart sessions that were already running. A running session may keep the account it started with. New sessions use the new account.
Can I sign in with claude auth login in a terminal?
Use Claude Accounts: Add Account (Log In) instead. The extension can't tell accounts apart by their tokens alone, so it syncs a login it didn't start into whichever account was active. If that happens, remove that saved account and add both accounts again.
Does it work with CLAUDE_CONFIG_DIR?
Yes, as long as VS Code can see the variable. If VS Code was started without it, set claudeAccounts.claudeConfigDir to the same folder. Claude Accounts: Show Status shows which Keychain item or file is in use.
Does it work in Cursor, Windsurf, or VSCodium?
It is published to Open VSX, where those editors install extensions from. On macOS, every editor shares the same saved accounts. On Linux and Windows, each editor keeps its own, since VS Code's secret storage belongs to one editor.
Does it work on Linux, Windows, or in a remote window?
Yes. On Linux and Windows it swaps Claude Code's .credentials.json. In a Remote SSH, WSL, or container window, the extension runs on the remote machine, where Claude Code runs too, and switches the login there.
What happens when I remove an account?
Its saved tokens are deleted. The live login is left alone, so you stay signed in.
Contributing
Contributions are welcome. See CONTRIBUTING.md.
License
MIT © Michael Cummings
Claude Code Login & Account Switcher is not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC.
