Flip between multiple Claude Code accounts without logging out and back in — every time.
Install • Quick Start • Commands • How It Works
Claude Code only supports one account at a time. If you have a personal subscription and a work subscription, switching means /logout → browser → log back in → every single time.
That's five steps and a browser redirect to do something that should be instant.
Claude Flipper saves your accounts once and flips between them with a single command.
Without Claude Flipper:
/logout → wait for browser → log in with other account → back to terminal
Five steps every time you switch. Easy to end up in the wrong account without noticing.
With Claude Flipper:
flipper swap && claude
One command. Instant. Always know which account is active.
brew install thecoderbuddy/tap/claude-flipper
flipper setup
source ~/.zshrcflipper setup adds a shell wrapper that injects your active account's token every time you run claude. This is required for account switching to work.
To upgrade:
brew upgrade thecoderbuddy/tap/claude-flipperNote: Upgrading does not affect your saved accounts. Your slots, credentials, and config backups in
~/.claude-flipper/are preserved across upgrades.
curl -fsSL https://raw.githubusercontent.com/thecoderbuddy/claude-flipper/main/install.sh | bash
flipper setup
source ~/.bashrcSupports x86_64 and arm64. Installs to /usr/local/bin/.
Note: On Linux, Claude Code stores credentials in
~/.claude/.credentials.json— no Keychain involved.flipper setupstill adds the shell wrapper as a best practice for consistent behaviour across platforms.
Coming soon.
Open Claude Code and make sure you're logged in with your first account:
claudeOnce you're in, exit Claude Code (/exit). Then run:
flipper addThis captures the session and saves it as slot 1.
You need to log out of the first account and log in with your second. Here's the exact sequence:
1. Open Claude Code:
claude2. Inside Claude Code, log out:
/logout
This clears the current session. Claude Code will confirm you've been logged out.
3. Exit and reopen Claude Code:
/exit
claude4. Inside Claude Code, trigger a fresh login:
/login
This opens your browser. Important: make sure you sign in with your second account in the browser — not the first one. If your browser auto-fills the wrong account, sign out of it in the browser first, then sign in with the correct account.
5. Once logged in, exit Claude Code:
/exit
6. Save the second account:
flipper addThis saves the second session as slot 2.
Why
/loginafter/logout? After/logout, if you just reopenclaudewithout running/login, Claude Code silently picks the last used account from its cache — you end up back on account 1 without realising it. Running/loginforces a fresh browser authentication so you can explicitly choose which account to log in with.
flipper listSLOT ACT EMAIL ORG
---- --- ----- ---
1 personal@gmail.com Personal
2 * work@company.com Acme Corp
flipper swap && claude # rotate to next account and open Claude
flipper swap 1 && claude # jump to slot 1 by number
flipper swap work@company.com # jump by emailNote: Always exit Claude Code (
/exit) before swapping. The desktop app overwrites credentials while running.
| Command | What it does |
|---|---|
flipper add |
Save the currently logged-in Claude Code account as a new slot |
flipper swap |
Rotate to the next account in the sequence |
flipper swap <slot|email> |
Jump to a specific account by slot number or email |
flipper list |
Show all saved accounts — active slot marked in the ACT column |
flipper status |
Show which account is currently active |
flipper setup |
Add the claude shell wrapper to your shell config (run once after install) |
flipper token |
Print the active account's access token (refreshes if expiring) |
flipper doctor |
Diagnose token expiry, keychain state, and config for all slots |
flipper remove <slot|email> |
Remove an account by slot number or email |
flipper reset |
Remove all saved accounts and wipe all Claude Flipper data |
Saving an account (flipper add):
- Reads your current Claude Code session from
~/.claude.json - Reads your credentials from the macOS Keychain (macOS) or credentials file (Linux)
- Backs them up to
~/.claude-flipper/under a numbered slot
Swapping accounts (flipper swap):
- Backs up the current account credentials and config
- Loads the target account's credentials and config from the backup
- Refreshes the access token if it is about to expire
- Updates
~/.claude.jsonwith the target account's session
Why the shell wrapper (flipper setup):
macOS Security.framework (used internally by Claude Code) cannot read Keychain entries written by third-party processes. Rather than fight the Keychain, flipper injects the token via the ANTHROPIC_AUTH_TOKEN environment variable — which the Anthropic SDK reads directly, bypassing the Keychain lookup entirely.
The wrapper added by flipper setup does this automatically every time you run claude:
claude() { ANTHROPIC_AUTH_TOKEN="$(flipper token)" command claude "$@"; }If anything fails mid-swap, it rolls back automatically — you're never left in a broken state.
"Not logged in" after swap
- Make sure you ran
flipper setupand reloaded your shell (source ~/.zshrc) - Check
flipper doctorto see token expiry and config state for all slots
Claude.app blocks the swap
- flipper blocks swaps while Claude.app (desktop) is running — it overwrites credentials
- Quit Claude.app (⌘Q) first, then run
flipper swap
Token expired
flipper swapautomatically refreshes tokens before writing them- If the refresh token is revoked (e.g. you ran
/logout), re-add the account:flipper add
~/.claude-flipper/ macOS and Windows
~/.local/share/claude-flipper/ Linux (XDG)
├── sequence.json Master account list and active slot
├── credentials/ Credential backups per slot
└── configs/ Config backups per slot
Claude Flipper does not collect, transmit, or share any data.
Everything stays on your machine:
- Credentials are stored locally with
0600permissions - The only network request flipper makes is refreshing expired OAuth tokens directly with Anthropic's token endpoint
- No telemetry, no analytics
- Open source — you can verify exactly what the code does
If Claude Flipper saves you time, consider buying me a coffee:
Built for Claude Code by Anthropic.
Bug reports, improvements, and platform-specific fixes are welcome.
- Open an issue to report a bug or request a feature
- Fork, fix, and open a PR — keep it focused on one thing
MIT — use it, fork it, adapt it.