How to switch Claude Code accounts at the limit
Short answer
Sign in as your other account with /login, or keep both logins in claude-swap and switch with one command. To switch before the limit, turn on claude-swap’s auto-switch, on its own or in ccdeck.
- Claude Code:
/loginmoves the session to the account you sign in as. - claude-swap keeps several logins, and
cswap switchorcswap automoves between them. - ccdeck shows each account’s 5-hour and 7-day quota, switches with a click, and runs claude-swap’s auto-switch with a home account it returns to.
What Claude Code says at the limit
A subscription has, in Anthropic’s words, “a rolling five_hour window and a weekly seven_day window.” When one runs out, Claude Code “blocks further requests until the reset time shown in the message,” such as You've hit your session limit · resets 3:45pm. /usage shows your plan limits and when they reset.
The quota is “tied to your account or plan”: another account you hold has its own. Claude Code’s own answers, in /rate-limit-options, are to wait and continue after the reset, add usage credits, or upgrade.
Claude Code: sign in as the other account
Run /login and sign in as the other account, which Anthropic’s documentation calls switching accounts. /status shows the account in use. From a shell, use claude auth login and claude auth status.
To stay signed in to both, Anthropic suggests a configuration directory for each account, “such as work and personal accounts.” Its example alias, for ~/.bashrc or ~/.zshrc:
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
What it misses. You switch by hand, signing in each time. /login also ends Claude Code’s wait to continue after the reset. A configuration directory has “its own settings, session history, and claude.ai login or API key,” so you choose the account when you start claude.
claude-swap: several logins, one command
claude-swap is an open-source command-line tool that keeps each account’s login and swaps the one Claude Code uses. Sign in to Claude Code as each account in turn, and run cswap add after each. Its README says not to run /logout first: Claude Code “may revoke the refresh token stored for the account you are leaving.”
uv tool install claude-swap
cswap listshows each account’s 5-hour and 7-day usage and reset times.cswap switchmoves to the next account, andcswap switch 2to account 2.cswap autoswitches 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.” A five-minute cooldown keeps it from flip-flopping, and--strategy consume-first“proactively keeps you on the account whose weekly window resets soonest.”cswap run 2starts Claude Code as account 2 in that terminal only.
What it misses. cswap auto works only while something runs it: a terminal, cron, or its macOS menu bar app. A running session takes the new account on its next message, on macOS after about 30 seconds, and “the first message on the new account may use extra usage as its conversation cache rebuilds.”
ccdeck: each account’s quota, and a home account
ccdeck is a free, open-source dashboard on your machine. Its Claude accounts panel opens from the stripe on the left, or with A, and reads the logins claude-swap holds. ccdeck can install claude-swap for you.
npx ccdeck --ref=switch-claude-code-accounts
- Each row shows the account’s 5-hour and 7-day quota as claude-swap last read it, and Switch makes it the active one.
- The active account is the one Claude Code is signed in to, so the panel follows a
/login. A login claude-swap does not hold is named there, with Add account. - Auto-switch, off until you turn it on, runs claude-swap’s engine about once a minute, at your threshold.
- Set as home, in an account’s ⋯ menu: Auto-switch takes you there, keeps you there until the threshold, and comes back once its 5-hour window has reset.
- Next account › Soonest weekly reset moves to the account whose 7-day window resets soonest, within 4 days, so quota about to reset is used first. Both choices can be set while Auto-switch is off.
- From a terminal,
ccdeck switch --bestgoes where Auto-switch would. Over SSH,ccdeck tuikeeps the accounts on one screen: switch, turn Auto-switch on or off, or sign an account in with a link opened in any browser.
What it misses. Claude accounts only, through claude-swap: a switch is a cswap switch, with the same delay. Home and the weekly rule move only to an account signed in, in rotation, read in the last 15 minutes and more than 5 points under the threshold. A cswap auto running in a terminal takes over, without the home or the weekly rule. Both choices are kept per machine.
More about Soonest weekly reset
It is ccdeck’s own rule, not claude-swap’s consume-first. Its moves below the threshold are made only while claude-swap is on its default strategy, best, so the two do not take turns. Below the threshold it moves only to an account whose week resets at least an hour sooner than the one in use, and not within 30 minutes of the last move. Home comes first. When no account fits, claude-swap decides, as before. The 4 days are 95 hours, and are not a setting.
Step by step
Sources
Read on . What ccdeck does is checked against ccdeck 3.48.0, and what another tool does against its own documentation.
- Claude Code docs: Authentication, Log in with multiple accounts
- Claude Code docs: Commands, All commands
- Claude Code docs: CLI reference, CLI commands
- Claude Code docs: Error reference, You've hit your session limit
- Claude Code docs: Interactive mode, Wait for a usage limit to reset
- Claude Code docs: Status line, Rate limit usage
- claude-swap README: Usage
- claude-swap README: Tips
- The ccdeck README at 3.48.0