FREE & OPEN SOURCE

Manage multiple Claude accounts
on one machine

Save several Claude Code subscription accounts and switch between them instantly with one command — no losing your subscription, no re-login.
Settings, MCP, skills, and history are all shared. Works on Windows, Linux, and macOS.

PowerShell
PS> irm https://raw.githubusercontent.com/yazelin/claude-auth-switcher/main/install-oneliner.ps1 | iex
bash / zsh
$ bash <(curl -fsSL https://raw.githubusercontent.com/yazelin/claude-auth-switcher/main/install-oneliner.sh)

Requires Git first (Linux/macOS also need jq and curl). No Git? See how to install it here

Solving the multi-account pain on Claude
SAVE

Multiple login states

Save each Claude account's login token as its own separate profile, so your personal and company accounts never interfere with each other.

SWITCH

Instant switch with one command

cl switch opens a menu — pick one, hit Enter, and it kills the running Claude first, then switches accounts.

KEEP YOUR SUB

Stay on subscription billing

Switching swaps your subscription identity too, so Claude Code stays on your Pro / Max subscription and never quietly drops to API billing.

SHARED

Settings and history fully shared

MCP tokens, settings, conversation history, skills, and plugins are all shared — only the account token switches, nothing else is affected.

What actually changes when you switch?
ItemLocationSwitched / Shared
Account token claudeAiOauth~/.claude/.credentials.jsonswitched per account
Subscription identity oauthAccount~/.claude.jsonswitched per account
MCP token mcpOAuth~/.claude/.credentials.jsonshared
Settings, conversation history, skills, plugins~/.claude/shared
Your Claude account identity actually lives in two files: the token in .credentials.json, and the subscription identity in ~/.claude.json. Swap only one of them and Claude Code treats it as a mismatch and falls back to API billing. cl rewrites both blocks together, so after switching you still draw on your subscription quota. Expired tokens are also refreshed automatically on switch.
From install to your first switch
1

Open PowerShell and paste the install command

Press Win + X, choose "Terminal" or "Windows PowerShell", copy and paste the command below in full (Ctrl+V), and press Enter.

PowerShell
PS> irm https://raw.githubusercontent.com/yazelin/claude-auth-switcher/main/install-oneliner.ps1 | iex

The install automatically wires up both your Windows PowerShell 5.1 and PowerShell 7 profiles and prints the next steps. When it's done, open a fresh PowerShell window.

2

Save your current Claude account

If your machine is already logged into Claude Code, run this line to save the existing login as a profile called "personal":

PowerShell
PS> cl import personal

"personal" is just a name — feel free to use any nickname that makes sense to you.

3

Add a second account

Run cl login with a name to open the browser OAuth login flow; once you finish logging in it's saved as a profile automatically:

PowerShell
PS> cl login company # once login finishes, the company profile is saved
4

View the status of all accounts

PowerShell
PS> cl list CURRENT PROFILE EMAIL PLAN USAGE * personal ya***@gmail.com max 5h 42% used @14:00 | wk 18% used @06/02 company ya***@company.com pro 5h 7% used @09:00 | wk 55% used @06/05

The * marks the account currently in use; emails are masked; the percentages are amount used (5-hour / weekly).

5

Switch accounts

Switch with the interactive menu — it kills the running Claude first, then switches accounts:

PowerShell
PS> cl switch
Or specify directly: cl use company  —  after switching just launch claude, no wrapper needed.
1

Open a terminal and paste the install command

You'll need git, jq, and curl first.

bash / zsh
$ bash <(curl -fsSL https://raw.githubusercontent.com/yazelin/claude-auth-switcher/main/install-oneliner.sh)
2

Reload your shell (or open a new terminal)

bash
$ source ~/.bashrc # zsh users: use source ~/.zshrc instead
3

Save your current account and add more

bash
$ cl import personal # save the current account $ cl login company # add a second account via browser OAuth
4

Switch accounts

bash
$ cl use company # switch to the company account (kills running claude first) $ claude # launch Claude Code as usual
cl usage side-by-side
PowerShell / bash — cl usage
PS> cl usage CURRENT PROFILE EMAIL PLAN USAGE * personal ya***@gmail.com max 5h 42% used @14:00 | wk 18% used @06/02 company ya***@company.com pro 5h 7% used @09:00 | wk 55% used @06/05

cl usage with no arguments refreshes the usage of every account live and lines them up in a table (equivalent to --all) — so you can see at a glance which account still has quota. Reset times are shown in your local time (Taiwan UTC+8).

What cl switch looks like
PowerShell / bash — cl switch
PS> cl switch select a profile: 1) personal 2) company choice: 2 killed 1 running claude process(es) before switching switched to 'company'

Type a number to pick an account, then Enter. Before switching it automatically kills any running Claude, so it can't write the old account's token back.

All cl commands
CommandWhat it does
cl login <name>Open browser OAuth to add an account and save it as a new profile
cl import <name>Save the current login state in ~/.claude as a profile
cl use <name>Switch the active account (kills running claude first)
cl switchSwitch accounts via an interactive menu, also killing claude first
cl killImmediately kill all running claude processes
cl listList all accounts in a table: active marker, email (masked), plan, cached usage
cl usage [name|--all]Live usage table for all accounts side by side (no argument = all); a single account shows the detailed breakdown
cl currentShow the name of the profile currently in use
cl remove <name>Delete a profile
cl psList detected claude processes (excludes this session)
cl doctorDiagnostics: paths, claude process state, profile overview
cl export <file>Back up all profiles (Windows .zip / Linux .tgz)
cl restore <file>Restore profiles from a backup archive
cl helpShow the built-in command help
FAQ
I don't have Git installed — what do I do?

Windows: in PowerShell, type:

winget install --id Git.Git -e --source winget

After it installs, close PowerShell and reopen it, and you'll have git.

Linux (Ubuntu/Debian):

sudo apt install git jq curl

macOS: type git in the terminal and macOS will prompt you to install the Command Line Tools; jq can be installed with brew install jq.

I get an "execution policy" error when running the install command?

Windows sometimes blocks PowerShell scripts. Run this line first to lift the restriction, then paste the install command again:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
The cl command doesn't work in a newly opened PowerShell window?

The install adds the setup to your PowerShell profile, so you need to reopen PowerShell for it to take effect. The installer already wires up both your Windows PowerShell 5.1 and PowerShell 7 profiles.

If it still doesn't work, check that your profile contains this line:

notepad $PROFILE

It should contain a line like . "C:\Users\YourName\claude-auth-switcher\shell\powershell.ps1". If it's missing, add it manually, save, and reopen PowerShell.

After switching, Claude is still on the old account / nothing changed?

The most common cause is that Claude was still running during the switch — a running session writes its old token back on its next API call, overwriting the switch.

cl use and cl switch both kill any running claude before switching by default, so normal usage won't hit this. If you added --no-kill yourself, remember to close Claude first.

Will switching lose my subscription and drop me to API billing?

No. Your Claude account identity is spread across two files: the token in ~/.claude/.credentials.json, and the subscription identity (oauthAccount) in ~/.claude.json.

cl rewrites both blocks together when switching, so Claude Code stays on your Pro / Max subscription. If a profile was saved with an older version of the tool and is missing the subscription identity, just run cl import <name> again to restore it.

Is the usage percentage "used" or "remaining"?

It shows the amount used. For example, 5h 42% used means this 5-hour window is already 42% consumed. For a single account, cl usage <name> also lists the weekly, weekly-opus, and weekly-sonnet breakdowns along with reset times.

(This is the opposite of the sibling project codex-auth-switcher — Codex shows the remaining amount.)

Are the tokens safe? Do they get uploaded to the cloud?

No. All tokens are stored only in the ~/.claude_auth_profiles/ folder on your own machine, and the tool runs entirely locally. On Unix the profile directory is set to 700 and the files to 600.

Don't commit ~/.claude_auth_profiles/ or the backups produced by cl export to Git; the backup files contain long-lived tokens, so delete them after transferring.