by realiti4
Switch between multiple Claude Code accounts, with automatic rate-limit rotation, usage dashboard, and parallel sessions
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
# Add to your Claude Code skills
git clone https://github.com/realiti4/claude-swapGuides for using cli tools skills like claude-swap.
Last scanned: 5/23/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-23T06:34:22.330Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}See how claude-swap compares with popular alternatives.
Multi-account switcher for Claude Code. Easily switch between multiple Claude accounts without logging out, or let it switch for you before you hit a rate limit. Track usage for every account in a live dashboard, and run accounts in parallel. Works with both the Claude Code CLI and the VS Code extension.
uv tool install claude-swap
pipx install claude-swap
git clone https://github.com/realiti4/claude-swap.git
cd claude-swap
uv sync
uv run cswap help
cswap upgrade # uv/pipx installs on macOS/Linux: auto-detects and upgrades
# or run your installer directly:
uv tool upgrade claude-swap
pipx upgrade claude-swap
Log into Claude Code with your first account, then:
cswap add
Log in with another account, then:
cswap add
Do not run /logout first: current Claude Code may revoke the refresh token stored for the account you are leaving.
Rotate to the next account:
cswap switch
Or switch to a specific account:
cswap switch 2
cswap switch user@example.com
cswap switch dev # or by alias, once set with `cswap alias 2 dev`
Not sure which one? cswap list is the dashboard — every account's plan, 5-hour and 7-day usage and reset times at a glance:
cswap list
Or let claude-swap auto-pick by remaining quota — cswap switch --strategy best (most quota left) or --strategy next-available (skip rate-limited accounts).
Note: You usually don't need to restart — on Linux/Windows the new account is picked up automatically, and on macOS after the Keychain cache expires. To apply it instantly, restart Claude Code or reopen the VS Code extension tab. See Tips for the per-platform details.
Let claude-swap watch your usage and switch for you. When the active account's 5-hour or 7-day window reaches the threshold (default 90%), it switches to the account with the most quota left — before you hit the limit, and safe to run while Claude Code is working:
cswap auto # foreground loop, polls every 60s
cswap auto --threshold 80 # switch earlier
cswap auto --weekly-threshold 97 # let the weekly window run higher before switching
cswap auto --model Fable # also switch when the Fable weekly limit is hit
cswap auto --strategy weekly-first # spend the soonest-expiring weekly quota first
cswap auto --once # single check-and-switch, for cron/scripts
cswap auto --dry-run # log what it would do, never switch
Strategies (--strategy, or cswap config set autoswitch.strategy):
| Strategy | Switches | Lands on |
|---|---|---|
best (default) |
when the active account reaches its threshold | the account with the most quota left |
weekly-first |
same as best |
the account whose weekly window resets soonest |
consume-first |
at the threshold, and earlier whenever an account that resets sooner has room | the account whose weekly window resets soonest |
priority-consume-first |
whenever a higher-tier account is usable | your highest tier (cswap priority), then the soonest weekly reset |
The weekly ones exist because weekly quota left unused at its reset is lost.
Per-account controls
cswap disable <num|email> holds an account out of rotation: auto-switch, bare cswap switch, and the best / next-available strategies skip it until cswap enable puts it back. It keeps its login and is still a valid explicit cswap switch <num|email> target.cswap threshold <num|email> <pct> gives one account its own switch-away line (50–99.9) in place of the global one.cswap priority <num|email> <tier> ranks accounts for priority-consume-first: higher tiers (0–1000, default 0) are used first. The other strategies ignore tiers.Good to know
priority-consume-first is the exception: it never lands on an account at or over its line, so it holds and keeps polling.--weekly-threshold 97 gives the 7-day and per-model windows their own line, so the weekly budget can run higher than the 5-hour window. --threshold, and any per-account threshold, then governs the 5-hour window only.--model Fable folds that model's weekly limit into the decision, for when you hit a per-model limit before the account-wide ones. Names are the per-model rows in cswap list (e.g. Fable: 100%), matched case-insensitively.--model windows alone.--include-api-key-accounts.For cron/systemd timers, --once reports the outcome in its exit code (0 switched, 1 error, 2 nothing to do, 3 blocked — no viable target), and --json emits one JSON event per line:
*/5 * * * * cswap auto --once --json >> ~/.cswap-auto.log 2>&1
Defaults like the threshold and cooldown are configurable with cswap config set autoswitch.threshold 80 — flags override them (see Configuration).
The exact rules (margins, landing, polling cadence, tier handling) are in docs/auto-switch.md.
Launch Claude Code as a specific account in the current terminal only — every other terminal and the VS Code extension stay on your default account, so two accounts can work in parallel.
cswap run 2 # launch Claude Code as account 2, here only
cswap run user@example.com # by email
cswap run 2 -- --resume # everything after '--' is forwarded to claude
cswap run 2 --no-share-history # keep this account's chat history to itself
Sessions use your normal ~/.claude setup (settings, CLAUDE.md, skills, MCP servers, etc.) and share its chat history, so a conversation started under one account shows up in --resume under the others.
~/.claude. History an account kept on its own before is merged in on its next launch, and nothing already saved is lost (a file that differs on both sides is kept aside in history-conflicts/ in the backup directory). cswap config set run.shareHistory false gives each account its own history; --no-share-history does it for one launch.history.jsonl) is shared only when Windows lets cswap create a symlink (Developer Mode, or an elevated terminal) and otherwise stays per-account.claude mcp add -s user) are mirrored from your default profile on every launch — manage them there; changes made inside a session don't persist. Definitions are copied as-is (including inline env/headers values), but MCP OAuth logins are not — HTTP servers may ask you to authenticate once per profile via /mcp.--no-share stops sharing your ~/.claude setup (settings, skills, etc.) and removes the mirrored MCP config (profiles that never mirrored are left alone). Chat history is separate: it stays shared unless you also pass --no-share-history.claude on that login instead of a session (a second copy of the active credential would go stale). Scripts that need the isolation guaranteed can pass --require-session, which refuses instead. When that login holds no usable token any more (missing, or emptied by Claude Code after a failed refresh), the account launches in its session profile from its stored login instead, since plain claude would only stop at "Not logged in".cswap switch refuses to move the default login onto its account if the stored backup has already fallen behind (activating it could only fail) — exit the session first, or pick another account.cswap run 2 -- -p "…" --output-format json | jq works.Bind a directory t
claude-swap is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by realiti4. Switch between multiple Claude Code accounts, with automatic rate-limit rotation, usage dashboard, and parallel sessions. It has 4,918 GitHub stars.
Yes. claude-swap passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/realiti4/claude-swap" and add it to your Claude Code skills directory (see the Installation section above).
claude-swap is primarily written in Python. It is open-source under realiti4 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh claude-swap against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Based on votes and bookmarks from developers who liked this skill