Background
Claude Code keeps one signed-in account per machine. I use a work account and a personal account on the same laptop, and switching meant signing out and back in each time.
CC Account Switcher stores several accounts and switches between them. Themes, settings and history stay as they are. It started as a fork of ming86/cc-account-switcher. I now maintain it and wrote most of the current code.
What it does
- Add, remove and list accounts, and switch by number, email or a profile name such as
work - Switch automatically when you
cdinto a directory mapped to an account - Switch automatically when a usage limit is hit, using a Claude Code hook
- Show what a switch would change with
--dry-run - The CLI and docs are also available in Japanese
Design
It is one script that runs on Bash 3.2, the version that ships with macOS, so it needs nothing else installed.
If a switch fails partway through, it restores the previous account.
Credentials are kept in the macOS keychain. On Linux and WSL they are kept in files that only the user can read.
Tests are written with bats and run in GitHub Actions. They cover concurrent runs, keeping accounts separate, and differences between platforms.
Install
brew install fairy-pitta/tap/ccswitch
# or
npx @fairy-pitta/cc-account-switcher --help