# Automatic switching

> With auto_switch on, ccam moves a Claude Code session stopped at its usage limit to another of your accounts with room and continues the conversation there.

Source: https://ccam.dev/en/features/auto-switch/ · Updated 2026-11-29

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](#anthropic-s-terms)). Without it, you switch yourself with `ccam next --continue` or `/ccam:switch` ([Continuing at the limit](https://ccam.dev/en/features/next.md)).

```console
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 side
```

**Team 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](https://ccam.dev/en/docs/faq.md#am-i-allowed-to-use-several-claude-code-accounts) and check with your organization and Anthropic before you rely on it.

## Turn it on

1. Turn on the [ccam plugin](https://ccam.dev/en/docs/install.md#claude-code-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`).
2. Add the setting at the top of `config.toml`, above the first `[[group]]`, `[[profile]]` or `[[folder]]`:

   ```toml
   # ~/.config/ccam/config.toml
   auto_switch = true   # Linux and macOS; turns the relay on too
   ```

3. Start new sessions through ccam: `ccam <name>`, a shortcut or the dashboard. `auto_switch` turns the [relay](https://ccam.dev/en/features/next.md#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.
4. Run `ccam doctor`. While `auto_switch` is 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](https://ccam.dev/en/features/doctor.md)).

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

1. Claude Code stops a turn at a usage limit. The plugin's hook picks another account with room and ends Claude Code.
2. 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).`
3. ccam prints the first line of the example above and runs `ccam next --continue` for 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.
4. The new session starts with a fixed message, the only message a move sends on your behalf (a move after `/ccam:switch` sends nothing):

```text
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:

```text
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:

1. ccam started the session in a terminal and keeps running alongside it. This holds for the interactive sessions you start after turning `auto_switch` on. A session started before, or under an older ccam, gets a notification that ends ``This 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 (`-p` runs and background sessions), `claude remote-control` and Claude Code started without ccam are never moved.
2. The account has the ccam plugin turned on and runs Claude Code 2.1.214 or later.
3. 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 limit` or `You'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.
4. ccam knows the account's plan, from its `.claude.json` or from what `ccam login` recorded. If not, the notification ends `ccam does not know personal's plan, so auto_switch leaves this session.`
5. 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.
6. 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.`
7. You have not typed a prompt since the limit.
8. Another account has room ([below](#which-account-it-moves-to)).

## Which account it moves to

ccam chooses as [`ccam next --auto`](https://ccam.dev/en/docs/account-selection.md#choosing-by-usage) 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](https://ccam.dev/en/docs/account-selection.md#when-auto-switch-chooses) lists every condition.

A window with a [limit record](https://ccam.dev/en/features/usage.md#the-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`](https://ccam.dev/en/features/next.md#continue), and ccam says how big it is. A move never uses [`--brief`](https://ccam.dev/en/features/next.md#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](https://support.claude.com/en/articles/12004354-purchase-and-manage-seats-on-team-plans#h_b8a7d07129); likewise for [Enterprise plans](https://support.claude.com/en/articles/13393991-purchase-and-manage-seats-on-enterprise-plans#h_fa6b9cade0)).

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](https://www.anthropic.com/legal/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](https://www.anthropic.com/legal/aup), 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.

## Related

- [Continuing at the limit](https://ccam.dev/en/features/next.md)
- [How ccam picks an account](https://ccam.dev/en/docs/account-selection.md)
- [Usage of every account](https://ccam.dev/en/features/usage.md)
- [Checking and repairing](https://ccam.dev/en/features/doctor.md)
