Multi-account switcher for Claude Code
open sourceMITself-hostablefree
claude-swap (cswap) is a Python CLI that keeps several Claude Code logins and switches between them without logging out, for the CLI and the VS Code extension. cswap auto watches each account's 5-hour and 7-day usage and, at a threshold (default 90%), switches to the account with the most quota left, or by weekly reset or priority strategies; it's safe while Claude Code is working, and a running session picks up the new login (on macOS once the Keychain cache expires, about 30 seconds). It stores credentials in the macOS Keychain or in files on Linux and Windows, and adds a usage dashboard (TUI), per-terminal session mode for running accounts in parallel, directory mappings, export and import, JSON output and an optional macOS menu bar app.
Problems it solves
- I have two Claude subscriptions and want Claude Code to move to the other one before I hit the limit
- switch Claude Code to another account without logging out and back in
- see every Claude account's 5-hour and weekly usage in one dashboard
- run two Claude Code accounts side by side in different terminals
- spend the Claude weekly quota that resets soonest before it's lost
- use my work Claude account in work repos and my personal one elsewhere, automatically
- a macOS menu bar app to switch Claude Code accounts with a click
- move my saved Claude Code logins to a new machine
- check Claude account usage from a script with JSON output
- switch Claude Code accounts from a cron job when usage runs high
- change which account the VS Code Claude extension uses
- a long Claude Code run stops on a usage limit while my other account has room
- hold one Claude account out of automatic rotation but keep it signed in
Features
- switch accounts by number, email or alias without logging out
- cswap auto: switch at a 5-hour or 7-day threshold (default 90%)
- strategies: best, weekly-first, consume-first, priority-consume-first
- per-account thresholds, priorities and disable/enable
- per-model weekly limits (such as Fable) in auto-switch decisions
- TUI dashboard with live 5h and 7d usage
- session mode: run an account in one terminal only, in parallel
- directory-to-account mappings
- export and import of accounts
- JSON output and an event stream for scripts
View 4 more
- optional macOS menu bar app under launchd
- setup-tokens and API keys as accounts
- holds Claude Code's credential locks while writing
- works with the Claude Code CLI and the VS Code extension
Limitations
- Doesn't switch providers set through ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN: those variables stay in effect after a switch1
- Doesn't apply a switch instantly on macOS: Claude Code caches Keychain credentials for about 30 seconds1
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what claude-swap does.
- Claude account rotator Claude Code mod: rotates between your Claude logins as their usage limits fill
- clauth Claude Code multi-account manager, usage monitor (CLI, TUI & cross-account delegation via MCP)
- cc-account-switcher Account Switcher for Claude Code
- cux Run multiple Claude Code accounts as one
- claude-multi-desktop Run multiple Claude Desktop accounts at the same time on a Mac
- Claude account rotator (Nathan Broadbent's fork) The account rotator with one coordinator for every session, a menu bar app and weekly-limit rotation
