Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Claude Code Login & Account SwitcherNew to Visual Studio Code? Get it now.
Claude Code Login & Account Switcher

Claude Code Login & Account Switcher

Michael Cummings

|
63 installs
| (0) | Free
Switch between multiple Claude Code accounts from the status bar. Your history stays put, and saved logins stay in secure storage.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Code Login & Account Switcher

Switch Claude Code accounts without leaving VS Code. Your history, projects, and settings stay put. Only the login changes.

VS Code Marketplace Open VSX version Open VSX downloads license GitHub stars

The Switch Claude account picker in VS Code, listing Work, Personal, and an expired Side project account, with Work shown in the status bar

Keep a work account and a personal one, or a Pro plan and a Team plan, and move between them from the status bar. Saved logins stay in your system's secure storage.

Why I built this

On macOS, Claude Code keeps its login in the Keychain. All of the account switchers I found on the VS Code Marketplace only worked on Linux and Windows, where Claude Code keeps its login in a file.

I wanted a switcher that reads the Keychain directly and keeps every token securely inside it.

It works on Linux and Windows too. There, saved logins go in VS Code's encrypted secret storage, not in another plain file.

Features

  • One click to switch. The status bar shows who is signed in. Click it and pick another account.
  • One shared history. There is a single ~/.claude, so conversations, projects, settings, skills, plugins, and MCP servers are the same on every account.
  • Saved logins stay encrypted. On macOS, each account gets its own Keychain item. On Linux and Windows, accounts go in VS Code's secret storage.
  • Works where Claude Code does. macOS, Linux, and Windows, including Remote SSH, WSL, and container windows.
  • Keeps up with token refreshes. Claude Code refreshes its tokens as it runs. The extension saves the fresh copy, so you can switch back later without logging in again.
  • One account per workspace, if you want. Change the switch scope, and a switch changes only the workspace you are in.
  • Consistent across windows. Every VS Code window reads the same saved state, so a switch in one window holds in the others.

Requirements

  • macOS, Linux, or Windows
  • Claude Code, signed in at least once. The Claude Code extension is enough, with or without the claude CLI installed.
  • VS Code 1.85 or later, or an editor that installs extensions from Open VSX

Install

Search for Claude Code Login & Account Switcher in the Extensions view, or run:

code --install-extension michaelcummingsofficial.claude-code-login-switcher

Cursor, Windsurf, and VSCodium install the same extension from Open VSX.

Quick start

  1. Sign in to Claude Code the way you normally do.
  2. Run Claude Accounts: Save Current Account and give the account a name.
  3. Run Claude Accounts: Add Account (Log In) to sign in to your next account. The current one is saved first.
  4. Click the account name in the status bar to switch.
  5. Restart any claude session that was already running.

Commands

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.
Claude Accounts: Change Switch Scope Choose whether a switch applies everywhere or to the current workspace.

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.switchScope global Where a switch applies. global changes the login everywhere. workspace changes it for the current workspace only.

How it works

  • The live login on macOS. Claude Code reads the Keychain item Claude Code-credentials for your macOS user. When CLAUDE_CONFIG_DIR is 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.json in its config folder instead, and so does the extension.
  • The live login on Linux and Windows. Claude Code reads .credentials.json in ~/.claude, or in CLAUDE_CONFIG_DIR when 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.json lists 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.json sits in the extension's storage folder. Each editor keeps its own accounts.
  • Account details. profiles.json holds 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.switchScope set to workspace, each account gets a folder of its own under logins/<id>, beside profiles.json. Everything in it links back to your real config folder, except the login. A switch sets CLAUDE_CONFIG_DIR to that folder for the workspace's new terminals and for the Claude Code panel.
  • 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.json inside the folder.
  • Shared between workspaces. Two workspaces on the same account use the same folder, so they share one login and its refreshes.

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 security tool 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.json and 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 the folder and its Keychain item.
  • With claudeAccounts.switchScope set to workspace, the extension sets CLAUDE_CONFIG_DIR for 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 itself makes no network requests and collects no telemetry. It runs the claude CLI, and on macOS the security tool, 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.

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.

History, projects, settings, skills, plugins, and MCP servers stay shared. Three things to know:

  • Open a new terminal or Claude session after a switch. Ones that were already running keep their account.
  • 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?

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. A workspace that used the account goes back to the shared login.

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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft