How to Switch Claude Code Accounts
Claude Code's native `/login` command switches the login used by the current workflow. For a repeatable Claude Code account switcher, save each account as an aisw profile, run `aisw use claude <profile>`, check it with `aisw status`, then start a new Claude Code process. AI Switcher Desktop exposes the same saved-profile switch as one click, and workspace bindings can make a repository refuse the wrong account.
Claude Code supports native account changes with /login, and its storage varies by installation. That native flow is useful for changing the current login, but it does not give you named local profiles, repository bindings, or a cross-tool context. If you are looking for a Claude Code account switcher, this is what aisw adds: each account becomes a named profile, so switching and verifying are one command each.
Profile names are local labels. aisw does not create Claude subscriptions, proxy prompts, or upload credentials; it manages the local credential and config boundary Claude Code already reads.
Before you start
Install aisw if you haven’t already:
brew tap burakdede/tap && brew install aiswCLI method
1. Save the account you’re currently signed into.
aisw initaisw init bootstraps ~/.aisw/, offers to install the shell hook, and, if it detects you’re already signed into Claude Code, Codex CLI, or Gemini CLI, offers to import each one as a named profile right there in the prompt. Accept the prompt and you’re done with this step. If you skip it, or you already ran init on this machine before, capture the account explicitly:
aisw add claude work --from-live--from-live captures whatever Claude Code account is currently active, without a fresh sign-in. Running aisw init again later is safe, it re-detects live accounts and reports current state without touching profiles you’ve already saved.
2. Add a second account.
If you want to add another account interactively (this opens Claude Code’s native OAuth flow):
aisw add claude personalOr save an API key directly:
aisw add claude work-api-key --api-key "$ANTHROPIC_API_KEY"Check what you have saved with aisw list claude.
3. Switch between them.
aisw use claude workEach use call writes the named profile’s credentials to Claude Code’s live location and records it as the active profile for that tool. The output says what changed:
Claude Code → work──────────────────
Auth : api-key Backend : file State mode : isolated
Effects Live tool configuration updated. Active profile updated. Claude will use isolated profile state when shell integration is active. Backup created before switching.On macOS, where Claude Code keeps live auth in the Keychain, the first switch can trigger a Keychain prompt so aisw can update Claude’s active credentials.
4. Verify, then start a new Claude Code process.
aisw status --tool claudeaisw verifyclaudeaisw status reports the recorded profile and cross-checks it against Claude Code’s live credential state. aisw verify checks every tool’s managed and live state and prints a fix for anything that does not line up. A Claude Code session that is already running keeps the account it started with, so the switch takes effect in the next claude you launch, not inside an open conversation.
Switch Claude Code accounts without logging out
You do not need to sign out and back in to move between accounts you have already saved. Run aisw use claude personal, verify, and start a new process. Go through Claude Code’s login flow only when adding an account or refreshing one whose login has expired.
If you only need Claude Code’s native login flow, run /login inside the current session. Use aisw when you want saved work, personal, or client profiles that can be checked before a new process starts and bound to a repository.
On Windows and in VS Code
The commands are identical on Windows, macOS, and Linux. --credential-backend chooses where aisw keeps each profile’s secret: file in the profile directory, or system-keyring for the OS keyring. It does not change where Claude Code itself stores its live login.
aisw add claude work --from-live --credential-backend system-keyringaisw use claude workaisw verifyAfter switching, open a new PowerShell or VS Code terminal so Claude Code starts with the selected profile’s environment. The Windows guide and the VS Code walkthrough cover the editor and shell details.
Make a repository pick the account for you
Switching by hand is easy to forget. For repositories where the wrong account matters, group the profile into a context, bind the repository to it, and start in warn mode:
aisw context create work --claude workaisw workspace bind . --context workaisw workspace guard --mode warnIn a git repository the binding is written to .git/info/aisw.json, so it is never committed. With the shell hook installed, every claude launch checks the binding first. Warn mode prints a warning and lets Claude Code start; once the mapping is right, aisw workspace guard --mode strict blocks the launch instead:
Error: workspace guard refused to launch claude. Expected context: 'work' Run 'aisw context use work'.One Claude Code account per project covers per-directory setups, and preventing the wrong account in a repository covers remote patterns and default rules.
Desktop method
The current public AI Switcher Desktop release covers macOS, Windows x64, and Linux x64. Download the matching build, then follow the same profile-switching flow below.

- Open AI Switcher Desktop and go to Overview.
- In the Claude Code column, select the profile you want active.
- Click Open Profile, then Activate, or use Quick Switch (⌘K) and type the profile name.
Use the CLI when switching belongs in a shell hook, script, or repository setup, and Desktop when you want to see the active profile before you change it. Both work on the same saved profiles.
Common problems
If /login or aisw use changes the account but Claude Code still shows the old state, quit Claude Code and start a fresh process. Some installs cache credentials in memory for the running session. If aisw status reports a mismatch between the recorded and live profile, run aisw verify for a full diagnosis and repair path. Claude Code switch account not working walks through the remaining cases.
On macOS, older Claude Code builds keep every OAuth login in one shared Keychain entry, so a per-profile config directory cannot hold its own login. aisw detects this and says so rather than pretending the profile is isolated:
isolated-mode Claude OAuth switching is unsupported for profile 'work'. This Claude install uses the legacy shared live Keychain credential, so CLAUDE_CONFIG_DIR isolates config/history but not the live OAuth credential. This is an expected upstream limitation, not an aisw corruption bug. Use shared mode instead: aisw use claude work --state-mode sharedRun the suggested --state-mode shared command, or use an API key profile for an account you switch to often.
If aisw add claude <name> --from-live fails with an error naming a different existing profile, that account is already saved under that other name, aisw checks the underlying Claude identity, not just the profile name, and refuses to create a duplicate. Use the existing profile (aisw use claude <existing-name>) or remove it first if you genuinely want to re-add it under a new name.
If aisw add claude <name> fails with “profile already exists”, that name is taken. Choose a different name, or remove the old profile with aisw remove claude <name> first. With --from-live only, --yes overwrites the existing profile instead; that replaces the stored credential, so make sure that’s what you want.
Frequently asked questions
Is there a command to switch Claude Code accounts?
Claude Code's own /login changes the signed-in account for the current setup. To switch between saved accounts with one command, save each one as an aisw profile and run aisw use claude <profile>.
Can I switch Claude Code accounts without logging out?
Yes. Once each account is saved as an aisw profile, aisw use claude <profile> applies it before the next Claude Code process, so you do not sign out and back in for every switch. You only go through Claude Code's login flow when adding a new account or refreshing an expired one.
Can I switch Claude Code accounts in the middle of a session?
No. A switch applies to the next Claude Code process, not to a conversation that is already running. Switch with aisw use claude <profile>, then start a new Claude Code session.
Can I use a work API key and a personal account on the same laptop?
Yes. Save the work key as one profile with aisw add claude work-api-key --api-key, keep the personal login as another, and switch between them with aisw use claude work-api-key or aisw use claude personal.
Does the account switcher work on Windows and in VS Code?
Yes. The aisw commands are the same on Windows, macOS, and Linux. In VS Code, or any editor terminal, open a new terminal after switching so Claude Code starts with the selected profile's environment.
Can I switch Claude Code without touching Codex CLI or Gemini CLI?
Yes. aisw use claude <profile> only touches Claude Code's credentials. Use a context if you want to switch multiple supported tools together.
Does an account switcher bypass Claude Code usage limits?
No. aisw only manages which of your own accounts is active on this machine. It does not proxy prompts, create subscriptions, or get around provider authentication, terms, or usage limits.