https://github.com/recepzgrmh/ccswitch
Instantly switch between multiple Claude Code accounts — no browser, no login codes. macOS Keychain-based session manager.
https://github.com/recepzgrmh/ccswitch
account-switcher claude claude-code cli developer-tools keychain macos python
Last synced: about 5 hours ago
JSON representation
Instantly switch between multiple Claude Code accounts — no browser, no login codes. macOS Keychain-based session manager.
- Host: GitHub
- URL: https://github.com/recepzgrmh/ccswitch
- Owner: recepzgrmh
- License: mit
- Created: 2026-05-07T10:01:08.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-07T12:03:19.000Z (about 2 months ago)
- Last Synced: 2026-05-07T12:08:45.662Z (about 2 months ago)
- Topics: account-switcher, claude, claude-code, cli, developer-tools, keychain, macos, python
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ccswitch
**Instantly switch between multiple Claude Code accounts — no browser, no login codes.**
If you use more than one Claude account (work, personal, backup), you know the pain: hit your rate limit, open the terminal, type `claude auth login`, wait for the browser, copy the verification code... every single time.
`ccswitch` saves each account's session to macOS Keychain and swaps the active credentials in under a second.
```
$ ccswitch use work
✓ switched to 'work' (work@example.com, pro)
```
---
## How it works
Claude Code stores its auth token in macOS Keychain under `Claude Code-credentials`. `ccswitch` saves a named snapshot of that entry for each account and hot-swaps it when you switch — no re-authentication needed.
Your tokens never leave your machine. Everything goes through the macOS Keychain API (`security`).
---
## Requirements
- macOS (uses Keychain)
- [Claude Code](https://claude.ai/code) CLI installed
- Python 3.8+
---
## Installation
### Homebrew (recommended)
```bash
brew tap recepzgrmh/ccswitch
brew install ccswitch
```
### One-liner
```bash
curl -fsSL https://raw.githubusercontent.com/recepzgrmh/ccswitch/main/install.sh | bash
```
### Manual
```bash
git clone https://github.com/recepzgrmh/ccswitch.git
cd ccswitch
bash install.sh
```
> Add `~/.local/bin` to your `$PATH` if prompted.
---
## Usage
### Save your current account
```bash
ccswitch save main
# ✓ saved as 'main' (you@example.com, pro)
```
### Add a new account
Opens a browser for login, then saves the session automatically.
```bash
ccswitch add work
# Browser opens → log in → session saved as 'work'
```
### Switch accounts instantly
```bash
ccswitch use work
# ✓ switched to 'work' in <1 second, no browser
```
### List saved profiles
```bash
ccswitch list
PROFILE ACCOUNT TYPE SAVED
────────────────────────────────────────────────────────────────────────
main you@example.com pro 2026-05-07 10:00
work work@company.com pro 2026-05-07 10:05 ◀ active
backup backup@gmail.com free 2026-05-07 10:10
```
### Show active account
```bash
ccswitch status
── Active session ──────────────────────────────
Account : work@company.com
Profile : work
Plan : pro (default_claude_ai)
Expires : 2026-06-15 12:00 UTC
── Saved profiles ──────────────────────────────
◀ work work@company.com pro
main you@example.com pro
backup backup@gmail.com free
```
### Remove a profile
```bash
ccswitch remove backup
# ✓ profile 'backup' removed
```
---
## Typical workflow
```bash
# First time setup — save all your accounts
ccswitch save main
ccswitch add work # opens browser for second account
ccswitch add backup # opens browser for third account
# Day to day — hit rate limit on 'main', switch instantly
ccswitch use work
# Check where you are
ccswitch status
```
---
## Security
- Credentials are stored in **macOS Keychain** under the service name `ccswitch-profiles`.
- The tool only calls the standard `security` CLI — no network requests, no third-party libraries.
- Tokens are never written to disk in plaintext.
---
## Uninstall
```bash
curl -fsSL https://raw.githubusercontent.com/recepzgrmh/ccswitch/main/uninstall.sh | bash
```
Or if installed via Homebrew:
```bash
brew uninstall ccswitch
brew untap recepzgrmh/ccswitch
```
---
## FAQ
**Does this work with Claude Max / Pro / Free?**
Yes. The tool works with any Claude Code subscription type.
**Will switching break anything mid-session?**
No. Claude Code reads credentials at the start of each request, so switching takes effect on the next command.
**Can I use this on Linux?**
Not yet — Linux doesn't have Keychain. A `libsecret` / `pass` backend is a potential future addition. PRs welcome.
**Is this official / supported by Anthropic?**
No. This is an unofficial community tool that interacts with Claude Code's local credential storage.
---
## Troubleshooting
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common issues.
---
## Contributing
Issues and PRs are welcome. Keep it simple — the goal is a single-file script with no dependencies beyond the Python standard library and macOS `security`.
---
## License
MIT