|
| Command | What it does |
|---|---|
Claude Accounts: Switch Account |
Pick a saved account and make it the live login. |
Claude Accounts: Use Account Everywhere |
Use one account in every workspace, including ones with their own. |
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: Log In Again |
Renew a saved account's expired login. It keeps its name and place. |
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. |
Claude Accounts: Change Switch Scope |
Choose whether a switch applies everywhere or to the current workspace. |
Claude Accounts: Toggle Usage |
Show or hide the window's 5-hour and weekly usage in the status bar. |
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, the usual install folders, and the Claude Code extension. |
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. |
claudeAccounts.showUsage |
false |
Show the 5-hour and weekly usage of the window's account in the status bar. Asks Anthropic for it at most every two minutes. |
claudeAccounts.switchScope |
global |
Where a switch applies. global changes the login everywhere. workspace changes it for the current workspace only. |
claudeAccounts.restartClaudeCode |
true |
Restart extensions when the window changes accounts, so the Claude Code panel uses the new one right away. |
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. The plan shown for the account is updated from it too.
Workspace accounts. Claude Code keeps one login per config folder. With
claudeAccounts.switchScopeset toworkspace, each account gets a folder of its own underlogins/<id>, besideprofiles.json. Everything in it links back to your real config folder, except the login. A switch setsCLAUDE_CONFIG_DIRto that folder for the workspace's new terminals and for the Claude Code panel.One account, one login. Every account's login lives in one place: the shared login, or its own folder. Nothing copies it to a second place, because Claude Code retires the old tokens every time it refreshes and a second copy would soon stop working. The account the shared login belongs to never gets a folder. A workspace that picks it follows the shared login.
Folders are never deleted. A Claude Code session in another window may still be using one. When a window starts, every folder gets its links back, and anything Claude Code wrote into one moves to your real config folder. A transcript in both places gets the lines it was missing. Any other file your config folder already has is kept under
removed/<id>/<time>instead of being overwritten.Workspace logins. On macOS, Claude Code keeps each folder's login in its own Keychain item, named
Claude Code-credentials-<hash>. On Linux and Windows, it is the.credentials.jsoninside the folder.Shared between workspaces. Two workspaces on the same account use the same folder, so they share one login and its refreshes.
Saved accounts only. A workspace returns to the shared login when its account is removed.
Everywhere at once.
Use Account Everywherenotes the account and the time inprofiles.json. It copies no tokens: each workspace points at the account's own login. VS Code remembers when each workspace last picked an account. One that picked before then, or never, follows the next time its window has focus. A window already on that account doesn't restart.Starting with Claude Code. The extension starts alongside the Claude Code panel and points it at the workspace's account before Claude Code checks the login.
Restarting Claude Code. Claude Code checks the login when it starts and keeps the answer. When a switch, a new login, a removal, or a scope change moves the window to another login, the extension restarts the window's extensions. So does a login that lands while Claude Code is signed out, which clears its sign-in screen. Claude Code starts again on the new login and picks its sessions back up. Turn this off with
claudeAccounts.restartClaudeCode.Usage. With
claudeAccounts.showUsageon, the extension reads the window's live login and asksapi.anthropic.com/api/oauth/usagefor its limits, the endpoint behind Claude Code's/usage. It asks at most every two minutes while the window has focus, and waits five minutes after an account is rate limited. It never refreshes a token. After a switch to an account whose token has expired, it checks every 15 seconds and shows usage once Claude Code refreshes the token.Expiring logins. Anthropic sets a login's expiry when you sign in. Refreshing doesn't extend it. Three days out, the status bar and the picker flag the account. Once Claude Code can no longer refresh a login, it clears the tokens, and the extension flags that too.
Logging in again.
Claude Accounts: Log In Again, the yellow status bar, or picking an expired account runsclaude auth login. The new tokens replace the saved account's own. A login is matched to a saved account by its email and organization, soAdd AccountandSave Current Accountrenew an account they already know instead of saving it twice.Finishing a login. While
claude auth loginruns, a notification shows a spinner and checks for the new login every few seconds. Once it lands, the account is saved. There is nothing to click.Logging in again in a workspace. A saved account signs in again where its login already lives, so every workspace using it gets the new login at once. A new account signs in to a folder of its own. A cancelled login keeps that folder for the next try.
Sign-ins from elsewhere. A sign-in the extension didn't start, such as
claude auth loginin a terminal or/loginin Claude Code, could be any account. The extension asksclaude auth statuswho signed in. A sign-in to the active account renews it. Any other account is never saved over it, and the status bar shows it as unsaved until you save it.
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.- A workspace account's folder holds links and, on Linux and Windows, that account's
.credentials.json. It is readable by your user only. Removing the account deletes its saved tokens. Its folder and the login inside it stay, so a session still running there keeps working. - Files Claude Code wrote into a folder move to your config folder. Ones that would overwrite a file there go to
removed/<id>/<time>besideprofiles.json, readable by your user only. The extension never deletes them. - With
claudeAccounts.switchScopeset toworkspace, the extension setsCLAUDE_CONFIG_DIRfor the window's terminals and extensions. The value is a folder path, never a token. - Error messages and logs never include token material.
- The extension collects no telemetry. It runs the
claudeCLI, and on macOS thesecuritytool, on your machine. - By default, the extension makes no network requests. With
claudeAccounts.showUsageon, it sends the window's access token toapi.anthropic.com, and nowhere else, to read usage. When Node's own request is turned away, it retries withcurland passes the token through stdin, never on the command line.
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.
Can each repo use a different account?
Yes. Run Claude Accounts: Change Switch Scope and pick "One account per workspace", or use the last entry in the switch picker. Then switch as usual. The account applies to that workspace only, and VS Code remembers it. A workspace that has not picked an account follows the shared login, and so does one that picks the shared login's account.
To put one account on every workspace for a while, run Claude Accounts: Use Account Everywhere, or pick "Use an account everywhere" in the switch picker. Each open window follows when you go back to it, and one already on that account stays as it is. Pick a workspace's own account again whenever you like.
History, projects, settings, skills, plugins, and MCP servers stay shared. Three things to know:
- Open a new terminal after a switch. Terminals that were already running keep their account. The Claude Code panel restarts on its own.
- Claude Code outside VS Code, such as in Terminal.app, uses the shared login.
- On Windows, the links need Developer Mode turned on.
Why does Claude Code show the wrong email in a workspace?
Claude Code stores the signed-in email with its shared settings, so every workspace sees the last one written. The tokens in use are still the workspace's own. The status bar shows the account that is really active.
Do I need to restart Claude Code after switching?
No. The extension restarts the window's extensions, and the Claude Code panel comes back on the new account with its sessions intact. Other extensions restart too, which takes a moment.
A claude session running in a terminal keeps its account until you restart it. With claudeAccounts.restartClaudeCode turned off, restart the panel's sessions yourself, or run Developer: Reload Window.
Why do I have to log in again?
Every Claude login expires on a date Anthropic sets when you sign in. Claude Code refreshes its short-lived tokens as it runs, but that doesn't extend the login itself. Nothing can keep it alive past that date, so the extension warns you three days ahead.
Click the yellow status bar, or run Claude Accounts: Log In Again. The account keeps its name, and switching to it works again.
Can I sign in with claude auth login in a terminal?
You can. A sign-in to the account that is already active renews it, matched by its email. A sign-in to any other account is never saved over the active one, and the status bar shows Claude: unsaved instead. Run Claude Accounts: Save Current Account, or use Claude Accounts: Add Account (Log In), which saves the account for you.
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.
Can it show my usage limits?
Yes. Run Claude Accounts: Toggle Usage, or turn on claudeAccounts.showUsage. A second status bar item, beside the account, shows the 5-hour and weekly usage, such as 5h 34% · wk 12%. Its tooltip lists each limit with its reset time. Right-click the status bar to hide either item on its own. It always shows the account the window uses, so each workspace shows its own.
Other usage extensions read a single login, so in a workspace with its own account they show the wrong one, or nothing.
What happens when I remove an account?
Its saved tokens are deleted. The live login is left alone, so you stay signed in. A workspace that used the account goes back to the shared login. Its login folder stays, along with any session still running in it, and history from its workspaces stays in your config folder.
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.
