A simple shell script to switch between multiple Claude Code accounts (e.g., personal and work).
Claude Code stores OAuth credentials in the macOS Keychain and account profile data in ~/.claude.json. This script saves and restores both, letting you swap accounts with a single command.
# Clone the repo
git clone https://github.com/benkruseski/ClaudeAcctSwitch.git
# Add to your PATH
ln -s "$(pwd)/ClaudeAcctSwitch/claude-switch" ~/.local/bin/claude-switchSave each account as a named profile:
# Log in to your first account and save it
claude auth login
claude-switch save personal
# Log out, log in to the other account, and save it
claude auth logout
claude auth login
claude-switch save workclaude-switch personal # Switch to personal account
claude-switch work # Switch to work account
claude-switch status # Show which account is active
claude-switch list # List saved profiles
claude-switch save <name> # Save current login as a profileAfter switching, restart any running Claude Code sessions for the change to take effect.
- macOS (uses Keychain for credential storage)
- Claude Code CLI
- Python 3 (for reading account metadata)