Automatic switching
On this page
With auto_switch = true (Linux and macOS), ccam moves a session to another account by itself when Claude Code stops it at a usage limit, and the conversation goes on there without a command from you. It is off by default and experimental, and turning it on may break the terms of your plan (below). Without it, you switch yourself with ccam next --continue or /ccam:switch (Continuing at the limit).
ccam: personal hit its 5-hour limit; continuing this conversation as side
→ personal → side
continuing "Fix the flaky tests" (about 182k tokens); prompt caches are not shared between organizations, so the first reply reads it all again; side does not share personal's history, so Claude Code copies it into sideTeam and Enterprise seats. On Team and Enterprise seats, auto_switch moves your work to another seat of the same organization, which may violate Anthropic's terms. Read the FAQ and check with your organization and Anthropic before you rely on it.
Turn it on
Turn on the ccam plugin in every account, and use Claude Code 2.1.214 or later, which passes its process ID to the plugin's hook (
CLAUDE_PID).Add the setting at the top of
config.toml, above the first[[group]],[[profile]]or[[folder]]:# ~/.config/ccam/config.toml auto_switch = true # Linux and macOS; turns the relay on tooStart new sessions through ccam:
ccam <name>, a shortcut or the dashboard.auto_switchturns the relay on, so ccam keeps running alongside each interactive session instead of replacing itself with Claude Code. That costs one waiting ccam process per session.Run
ccam doctor. Whileauto_switchis on, it warns about accounts without the ccam plugin and about Claude Code versions older than 2.1.214, and for seats it repeats Anthropic's seat rule (checks).
On Windows the setting is ignored, and ccam doctor says so. There, with relay = true, /ccam:switch and /exit still move a conversation to another account.
What happens at a limit
- Claude Code stops a turn at a usage limit. The plugin's hook picks another account with room and ends Claude Code.
- ccam, running alongside the session, shows a desktop notification in terminals that support one, such as
ccam: personal hit its 5-hour limit (resets 3:29am). Moving this conversation to side (12% of its 5 hours used, the least). - ccam prints the first line of the example above and runs
ccam next --continuefor that session as the chosen account. That prints the other two lines and starts Claude Code with the session's options, permission mode, effort level and agent, as the relay does. - The new session starts with a fixed message, the only message a move sends on your behalf (a move after
/ccam:switchsends nothing):
Your usage limit was reached and ccam moved this conversation to another account. Continue the task you were working on when the limit was reached; do not repeat work that is already complete.When a subagent hit the limit, the message is this one instead, because the subagents, workflows and background commands stopped with the old session:
A subagent hit your usage limit and ccam moved this conversation to another account. The subagents, workflows and background commands that were running then have stopped, and their results may be missing: run again what the task still needs, then continue it; do not repeat work that is already complete.If the new account reaches its limit too, the same happens there. The limit records keep the chain from going back to an account before its reset, so when every account is full, the session stays on the last one.
To stop a move that has started, press Ctrl+C while Claude Code closes: ccam: switch cancelled. Run `ccam next --continue` later to continue the conversation.
When ccam moves a session
ccam moves a session only when all of these hold:
- ccam started the session in a terminal and keeps running alongside it. This holds for the interactive sessions you start after turning
auto_switchon. A session started before, or under an older ccam, gets a notification that endsThis session started before auto_switch was on or under an older ccam, so ccam cannot move it: type /exit, then run `ccam next --continue`.Unattended sessions (-pruns and background sessions),claude remote-controland Claude Code started without ccam are never moved. - The account has the ccam plugin turned on and runs Claude Code 2.1.214 or later.
- Claude Code wrote the refused request into the conversation, with the time it resets, for that account's 5-hour, weekly, Opus, Sonnet or Fable limit.
- When a Fable model has used up its weekly allowance, Claude Code says
You've hit your Fable limitorYou're out of usage credits, and the refused request names the Fable week. That is the Fable limit, and the next account needs room in its own Fable week. - A spend limit, usage credits running out on any other request, a stop set by an organization, a server throttle and an API key's rate limit never move a session.
- A subagent's or workflow agent's limit counts, even while the main conversation only waits for it. When that is a weekly Opus, Sonnet or Fable limit, the session moves only if the conversation itself runs on that model.
- When a Fable model has used up its weekly allowance, Claude Code says
- ccam knows the account's plan, from its
.claude.jsonor from whatccam loginrecorded. If not, the notification endsccam does not know personal's plan, so auto_switch leaves this session. - The session is not connected to Remote Control. As another account it would not reconnect to the app you drive it from, so it stays, and the notification says so.
- The limit resets more than 15 minutes from now. For a shorter wait ccam leaves the session to Claude Code:
ccam: personal hit its 5-hour limit, which resets in 9m; ccam leaves this session to wait for it. - You have not typed a prompt since the limit.
- Another account has room (below).
Which account it moves to
ccam chooses as ccam next --auto does, with auto_max_usage, auto_strategy and the conversation's model, among accounts of the same kind as the one you leave: another seat of the same Team or Enterprise organization, or another personal plan (Pro or Max). cross_org and --cross-org do not apply here. The account must also be logged in with a login Claude Code can renew, have a plan ccam knows, have usage credits off, have trusted this folder in Claude Code and, when the conversation runs as an agent, share that agent. How ccam picks an account lists every condition.
A window with a limit record counts as full, and an account another session moved to in the last 2 minutes comes after the others.
When nothing moves
When no other account has room, nothing moves: Claude Code handles the limit as usual, waiting in the session or offering its options. The notification says which account frees up first, for example ccam: personal hit its 5-hour limit (resets 3:29am). None of your other personal plans has room now; side frees up first, at 12:30am. Claude Code waits for personal here; /ccam:switch side after 12:30am moves it sooner. For seats it says None of your other accounts in Acme has room now.
When the last account conditions leave out every account with room, the notification names the account and the reason:
side has not trusted this folder yet, so the conversation was not moved there. Open the folder once as side to allow it.side has room but its usage credits are on, so auto_switch did not move the conversation there; /ccam:switch side moves it.This conversation runs as agent "reviewer", and side does not share personal's agents, plugins and settings, so auto_switch did not move it there.
The hook learns that a conversation runs as an agent from the agent setting, or from the row naming the agent that Claude Code writes into the conversation from time to time and when the session ends. If so far only the session's --agent names it, and the chosen account does not share the agents, ccam next --continue starts nothing and keeps the note, and a second desktop notification says ccam: this conversation runs as agent "reviewer", and side does not share personal's agents, plugins and settings, so ccam did not move it there. The error on standard error adds: Its note stays: `ccam next --continue` continues it later, and `ccam personal --resume <session id>` continues it as personal after the reset.
What a move costs
- Claude Code restarts, which takes a few seconds.
- The background shells, dev servers and agents that Claude started stop with the old session.
- The new account reads the whole conversation again with its first reply, as with
ccam next --continue, and ccam says how big it is. A move never uses--brief.
What it never does
auto_switch never switches before Claude Code reports a limit, never watches your usage in the background, and never copies, renews or passes on a login.
Anthropic's terms
On Team and Enterprise seats, auto_switch moves your work to another seat of the same organization. Anthropic's help center says "Each seat on a Team plan is assigned to one named individual, and only that person may use it" and "Users can't route their work through another user's account to use that user's remaining usage" (Team plans; likewise for Enterprise plans).
For personal plans (Pro, Max), Anthropic's terms do not say whether your own accounts may take over from each other automatically at a limit. The Consumer Terms forbid accessing the Services "through automated or non-human means, whether through a bot, script, or otherwise" unless Anthropic explicitly permits it, and a move sends one of the fixed messages above on your behalf. The Usage Policy, in effect since November 12, 2026, lists "Intentionally bypass or interfere with capabilities, restrictions, or guardrails established within our products" among the things it prohibits.
ccam does not claim that auto_switch complies with these terms. Turning it on is your call, and so is the risk: Anthropic may suspend an account, or a Team or Enterprise organization's access, when it believes the terms are broken.