Claude Code model router

claude-swap

Switches between multiple Claude Code accounts with automatic rate-limit rotation.

4,403 stars 475 forksModel routers & proxies Source

Install

Install
uv tool install claude-swap
From source
git clone https://github.com/realiti4/claude-swap.git

From the README

claude-swap

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.

Installation

Using uv (recommended)

Using pipx

From source

Updating

Usage

Add your first account

Log into Claude Code with your first account, then:

Add more accounts

Log in with another account, then:

Do not run /logout first: current Claude Code may revoke the refresh token stored for the account you are leaving.

Switch accounts

Rotate to the next account:

Or switch to a specific account:

Not sure which one? cswap list is the dashboard — every account's 5-hour and 7-day usage and reset times at a glance:

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.

Automatic switching

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:

How it behaves & advanced usage

- Runs safely alongside Claude Code: switches take the same credential locks Claude Code uses, so a swap never collides with a token refresh.
- A cooldown (default 5 min) and a hysteresis margin stop it…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
3 November 2026
Topics
account-manageraccount-switcheranthropicclaudeclaude-codeclimulti-accounttui

FAQ

What is claude-swap?

Switches between multiple Claude Code accounts with automatic rate-limit rotation. It is a model router for Claude Code, from realiti4/claude-swap on GitHub.

How do I install claude-swap?

Run uv tool install claude-swap, then follow the setup in the README.

Is claude-swap popular?

realiti4/claude-swap has 4,403 GitHub stars and 475 forks. It was last updated on 3 November 2026.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.