A lot of people have more than one Claude account.
Hit the 5-hour limit, switch to another and keep going.
But more accounts brings problems: after switching, an open window seems to still use the old account; one account suddenly shows "can't read quota," you think it's banned, but the login token just expired, or two tools are fighting over the same account's token.
This organizes cswap, the tool I use to manage accounts, from install to troubleshooting.
Good for: people with two or more Claude subscriptions who use Claude Code in the terminal. With one account, or on a relay or the API, only the "check usage" and "troubleshooting" sections apply.
cswap is open source, MIT, by realiti4 — I didn't make it.
Repo: github.com/realiti4/claude-swap
I went through its source (v0.25.0), and every step below is checked against the code.
One thing first: a switcher is for managing accounts, not for dodging bans. The reason is in the last section.
01 | First, understand what switching swaps
One Claude Code "login" is two things:
① The token in the keychain (on Linux, the file ~/.claude/.credentials.json)
② The account info in ~/.claude.json
What cswap does is keep a copy of these two for each account. To use an account, it swaps that pair in.
02 | Install, and take your accounts in
Prerequisite: Claude Code is already installed. Below uses Mac; Linux is basically the same.
① Install
If you don't have uv, run brew install uv first, or uv's official one-liner curl -LsSf https://astral.sh/uv/install.sh | sh. With pipx, replace the first line below with pipx install claude-swap.
uv tool install claude-swap
cswap --version
If it says the cswap command isn't found, run uv tool update-shell and open a new terminal.
② Take in the first account
Open Claude Code, type /login, and log into account A in the browser. After logging in, quit Claude Code and run cswap add in the terminal.
③ Take in the others
Open Claude Code again, /login into account B, quit, then cswap add. Repeat for each account.
④ Check
Run cswap list; when each account shows a 5-hour / 7-day percentage, they're in.
Two reminders:
Don't take accounts in with a token from
claude setup-token. It only has model-call permission, can't read usage, cswap will showusage unavailable, and auto-rotation will skip it.
Don't sync the
~/.claude-swap-backupdirectory to a cloud drive — it holds each account's info. On Mac the token is mainly in the keychain; on Linux the token also lives in this directory, and the.encfile cswap uses is only base64-encoded, not encrypted.
03 | Before switching, glance at usage
cswap list
This is the real output of my own account pool, with emails and IDs masked:

Reading it:
(active) → the account currently in use
5h / 7d → the 5-hour and 7-day limits, followed by the percentage used and the reset time
ahead of pace → used faster this week than the clock, e.g. only 20% of the week has passed but 40% of the quota is used
· 7m ago → data fetched 7 minutes ago, not just now
The second account in the image is at 100% of its 7-day usage and won't recover until October 15 — don't switch onto it these days.
Switch onto an account where both numbers are low; leave the ones near 90% alone.
These numbers are cswap querying the official usage API with each account's own token. Don't count local session records to guess usage — desktop and web consumption isn't recorded on your computer.
Two handy extras: add --token-status to also see how fresh the token is; if you don't want to type commands, cswap tui is a terminal panel, and on Mac cswap menubar attaches to the menu bar.
Also don't write a loop that keeps running cswap list. This API is rate-limited; query too often and it returns 429, and cswap waits on its own: from 30 seconds, doubling each failure, up to 10 minutes, showing old data during that time.
04 | Pick a switch mode by scenario

The quick map:
Current account hit the wall → cswap switch --strategy best
Two accounts working at once → cswap run 3
A project always uses one account → cswap map 3 ~/my-project
Don't want to manage it, switch near full → cswap auto
One at a time below.
Scenario 1: the current account hit the wall, swap it all out
cswap switch --strategy best
Auto-switches to the account with the most left. For a specific account use cswap switch 3; with no number it rotates to the next.
It writes the new account's token to the keychain, then swaps the account info in ~/.claude.json, touching no other config.
Note that an open window won't switch along immediately. Claude Code caches the token in memory and, on Mac, re-reads it after about 30 seconds. In a hurry, close the window and reopen.
So I put a shortcut roughly like this in ~/.zshrc, doing the switch and reopen in one step:
# switch to the account with the most left, then reopen claude
ccgo() {
cswap switch --strategy best || return $?
env -u ANTHROPIC_API_KEY \
-u ANTHROPIC_AUTH_TOKEN \
-u CLAUDE_CODE_OAUTH_TOKEN \
claude "$@"
}
Hit the wall, type ccgo to open a new conversation, or ccgo -c to continue the most recent one.
Those middle env -u lines strip three environment variables first. As long as ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN or CLAUDE_CODE_OAUTH_TOKEN is set, Claude Code uses them directly regardless of which account you logged in — and the switch is wasted.
Scenario 2: two accounts working at once, one terminal one account
cswap run 3
Affects only this terminal; the global login is untouched (cswap marks this feature experimental itself).
It works by giving this terminal its own config directory (CLAUDE_CONFIG_DIR), fully separating its login from the global one; your settings.json, CLAUDE.md, skills and so on are carried over by symlink, so it feels the same as usual.
Continue account 3's most recent conversation → cswap run 3 -- --continue
Pick from account 3's history → cswap run 3 -- --resume
Arguments after -- pass straight through to claude. Conversation history is stored per account by default, so this only continues account 3's own; to share one history across accounts, use cswap run 3 --share-history (not supported on Windows).
This way one terminal runs account A and another runs account B, without fighting.
Scenario 3: a project always uses one account
cswap map 3 ~/my-project
After binding, typing claude directly in the project won't switch accounts. You have to start it with cswap run (no number) for it to recognize the directory is bound to account 3 and open it the Scenario-2 way.
Auto: switch when near full
cswap auto
Keep a terminal open running it; close it and it stops switching.
By default it checks every 60 seconds, and when the current account's 5-hour or 7-day usage passes 90% it switches to the account with the most left; accounts whose token can't refresh are skipped. To keep your main account out of rotation, use cswap disable 1.
05 | An account "suddenly died"? Don't delete it yet

I've hit this one.
Once an account showed "can't read quota," I assumed it was dead and deleted it from cswap. At month end it had been fine all along — the login token had just expired.
Remember one thing first: Claude's refreshToken is single-use.
After the token expires, exchanging the refreshToken for a new one makes the server issue a new refreshToken too, voiding the old one on the spot.
So if one account sits in two tools at once (say cswap plus an API proxy), whoever refreshes first kills the copy the other side stored — and it looks like the account died.
Check in this order:
① Check the token
Run cswap list --token-status. Just expired? Usually nothing to do: an idle account refreshes itself when cswap checks usage; the active account renews when you open Claude Code.
② Check the log
grep "Usage fetch failed" ~/.claude-swap-backup/claude-swap.log | tail -5
Look at the reason at the end of each line:
timeout → network issue, check the proxy first
http-429 → queried too often, let it recover
http-403 → wait a bit. I had an account on 403 for over a day, touched nothing, and it fixed itself
http-401 → keep checking
③ Check double-management
Is this account still on another tool or another computer? Keep only one managing it.
④ Confirm whether it's banned
When cswap shows refresh token dead and the log is http-401, a ban and a dead token look almost identical. Open the claude.ai login page first, then check the sign-up email.
If it's not banned, /login the account again in Claude Code, then cswap add; the original account updates in place without adding a duplicate.
06 | The last red line: switching doesn't change the device ID

~/.claude.json also has a userID, generated randomly on first run and constant after — it's Claude Code's device ID.
In my local 2.1.282 client I found the reporting event's structure: the device ID device_id and the account account_uuid go out together in the same record. A global switch only swaps the account info; this ID stays.
In other words, several accounts rotated globally on one computer look, on Anthropic's side, like: one device, several accounts, used in rotation.
So my approach and advice:
My computer currently holds two accounts, the two in the screenshot above, and I accept that risk myself. With only one main account, don't add more onto the same computer.
If you really need to run several accounts at once, split machines and environments — don't expect a switcher to hide you.
cswap's value is knowing at any moment which account is still usable and switching without fumbling. It isn't a ban-dodge tool.
Command list
This is written against v0.25.0; by the time I finished it was at 0.26.0 — upgrade with cswap upgrade. If a command doesn't match, go by the author's repo: github.com/realiti4/claude-swap
# Install (no uv? brew install uv first; command not found? uv tool update-shell)
uv tool install claude-swap
# Add an account: /login in Claude Code first, quit, then run
cswap add
# Check usage
cswap list # each account's 5-hour / 7-day usage
cswap list --token-status # also see token status
# Global switch
cswap switch --strategy best # switch to the account with the most left
cswap switch 3 # switch to account 3
cswap switch # rotate to the next
# Use one account in the current terminal only
cswap run 3
cswap run 3 -- --continue # continue account 3's most recent conversation
cswap run 3 --share-history # share one conversation history across accounts
# Bind a project to an account: then start with cswap run in the project dir
cswap map 3 ~/my-project
cswap run
# Auto-switch (keep it running)
cswap auto
cswap disable 1 # keep account 1 out of auto-rotation
# Troubleshoot: see the recent failure reasons
grep "Usage fetch failed" ~/.claude-swap-backup/claude-swap.log | tail -5
Anthropic's risk-control rules have never been public, and no one can promise that following this means no ban.
What a tool can help with is managing these accounts smoothly; whether an account itself runs into trouble still comes down to how you use it.
SOURCE AND VERIFICATION
Sources and limits
This only covers the open-source tool cswap's normal account-management use and troubleshooting, checked against its public source; it provides no account trading, ban evasion or risk-control bypass.
Verification: Checked install, switching, usage-query and troubleshooting commands line by line against cswap v0.25.0's source, and ran them on macOS + Claude Code; confirmed the device-ID reporting structure by searching the local Claude Code 2.1.282 client; Windows and API-relay scenarios aren't covered, Anthropic's risk-control rules aren't public, and following this doesn't guarantee no ban.
ONE PRACTICAL NEXT STEP
How do you manage your Claude accounts?
This only covers cswap plus Claude Code. If you switch a different way, or manage accounts on an API relay, send me your setup — a few more side by side make the picture more solid.
Message me