> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usepitboard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatic switching

> Which account the automatic switch picks, and each reason it stays or decides nothing, with its text, its code and what ends it.

The app and `pitboard watch` pick an account by the same rules. The app shows each reason in a notification, as the [menu bar app](https://docs.usepitboard.com/reference/mac-app.md#notifications) and [the app on Windows](https://docs.usepitboard.com/reference/windows-app.md#notifications) list, and under the share in [Settings](https://docs.usepitboard.com/reference/settings.md#when-a-limit-reaches). `pitboard watch` prints it in [its lines](https://docs.usepitboard.com/reference/account-commands.md#watch), and with `--json` gives the code in [`reason`](https://docs.usepitboard.com/reference/json-output#watch-events).

## Which account it switches to

Pitboard watches every limit of the account in use, a model's weekly limit included. A limit counts at the whole percentage Pitboard shows, so 94.5% reaches 95%.

Once a limit reaches the share, Pitboard looks for another enrolled Claude Code account that:

* Has a parked login that has not expired.
* Has a reading from Anthropic.
* Has used less than the share of every limit it has.
* Has not been passed over at this limit, as [When a try fails](#when-a-try-fails) says.

Of those, Pitboard picks by the order chosen in [Use first](https://docs.usepitboard.com/reference/settings.md#use-first), or given to `pitboard watch` as `--order`.

Under **In Your Order**, `your-order`, it picks the first of them in the order you set with [`pitboard order`](https://docs.usepitboard.com/reference/account-commands#order) or in **Use first**, whatever each has left.

The other two orders rank them:

| Rule | **Most Left**, `most-left` | **Resets Soonest**, `resets-soonest` |
| - | - | - |
| First | An account without a weekly limit for all models, such as a Team seat. What it leaves unused is lost at each five-hour reset. | The same |
| Then | The most room in the limit at the share. An account without that limit counts as having used none of it. | The account whose weekly limit for all models resets first. One whose reset has passed or is not known comes last. |
| On a tie | The account least full in its other limits | The most room in the limit at the share, then the least full in the other limits |

Resets less than a minute apart count as one. A limit past its reset time counts as reset.

A reading may leave a limit out when Anthropic answers without its list of limits, or Pitboard cannot read the answer whole. Such a reading qualifies only with the five-hour and weekly limits, and with a model's weekly limit when that one is at the share. Pitboard counts it as having a weekly limit for all models.

When several limits are at the share, Pitboard acts on the fullest one it has not already left or given up on.

The app's offer once an account runs out follows the same rules at 100%.

## Before the share

Under **Resets Soonest**, Pitboard also switches while no limit of the account in use has reached the share. Anthropic resets each account's week at a fixed time of its own, and what the account leaves unused that week is lost then.

Pitboard does this only from an account the automatic switch put in use. On an account you put in use yourself, by a switch, a sign-in or enrolling it, Pitboard waits until a limit reaches the share.

Pitboard switches to the first account, by the order above, that:

* Comes before the account in use: it has no weekly limit for all models and the account in use has or may have one, or both weeks have a known reset and its week resets more than a minute sooner.
* Has used less than the share of every limit it has.
* Has used no more of its five-hour limit than the account in use. An account without a five-hour limit counts as having used none.
* Has a reading Anthropic gave within 15 minutes of when Pitboard could next ask about it. Pitboard waits 3 minutes between asks about an account with a five-hour limit, and about the account in use. It waits 100 minutes between asks about a parked account with only a weekly limit.

It never switches before the share between two accounts without a weekly limit for all models.

Pitboard switches to an account before the share once, until that account reaches the share of a limit while in use or its week resets. Left at its five-hour limit, the account is switched back to once that limit resets, while its week still resets first.

It holds back without saying so for the 5 minutes after any switch, after a try that came to nothing, and while Claude Code signs in another way. `pitboard log` records each switch as `auto-switch`.

## When it stays on the account

Once a limit of the account in use reaches the share, Pitboard stays on the account while one of these holds. `pitboard log` records `auto-stay` with the code, once for each limit and its reset.

| Code | Text | Ends when |
| - | - | - |
| `no_room` | `no other Claude Code account has room below 95% in every limit` | Another account [qualifies](#which-account-it-switches-to), or the limit resets. |
| `already_switched` | `this limit was switched away from once already, and is not again before it resets` | The limit resets. |
| `attempts_spent` | `3 attempts to switch away from this limit failed, and none is made again before it resets` | The limit resets. |
| `settling` | `the account was put in use less than 5 minutes ago` | 5 minutes pass. |
| `auth_overridden` | `Claude Code signs in another way, set by ANTHROPIC_API_KEY in the environment, so a switch would change nothing its sessions use` | You remove that setting, which `pitboard doctor` also names. |

The app starts each text with a capital letter and ends it with a full stop.

Where Anthropic has given no reading of an account that could qualify, `no_room` ends `, and there is no reading of personal from Anthropic yet`.

`settling` counts from the switch, sign-in or enrolment that put the account in use. An account the automatic switch put in use stops settling once Anthropic has answered about it since.

`already_switched` holds only on an account you put back in use. An account the automatic switch put back is switched away from again at the share.

In JSON, `no_room` is an event of its own. The other codes are the `reason` of a `skipped` event.

## When it decides nothing

While one of these holds, Pitboard does not decide whether to switch.

| Code | Text | App | Ends when |
| - | - | - | - |
| `switch_interrupted` | `a switch was interrupted, and the next change you make finishes it` | **A switch didn't finish, and the next change you make finishes it.** | Your next change finishes it, or [`pitboard abandon`](https://docs.usepitboard.com/reference/recovery-commands#abandon) gives up on it. |
| `custom_oauth_endpoint` | `Claude Code uses a custom OAuth endpoint, and Pitboard does not act on Claude Code then` | The same | You unset [`CLAUDE_CODE_CUSTOM_OAUTH_URL`](https://docs.usepitboard.com/reference/environment-variables#custom-oauth-endpoint). |
| `nothing_signed_in` | `Claude Code has no login stored` | **Claude Code isn't signed in.** | You sign in. |
| `not_enrolled` | `Claude Code has me@example.com's login stored, and that account is not enrolled` | **Claude Code is signed in to [me@example.com](mailto:me@example.com), an account you haven't added.** | You enrol it. |
| `not_identified` | `whose login Claude Code has stored could not be told (could not reach Anthropic)` | **Pitboard couldn't tell which account Claude Code is signed in to (could not reach Anthropic).** | A later try identifies it. |
| `no_reading` | `there is no reading of work from Anthropic yet` | The same | Pitboard's next read gets one. |

## When a try fails

Pitboard records each try in `autoswitch.json` before anything moves, so a try stopped partway still counts. The next try waits 1 minute, and each failure in a row doubles the wait, up to 15 minutes. A failure that may pass, such as Anthropic out of reach, does not count toward `attempts_spent`.

These refusals over the account a try would switch to pass that account over until the limit resets. The next try picks another at once.

| Code | When |
| - | - |
| `account_unknown` | The account is no longer enrolled. |
| `nothing_parked` | The account has no parked login. |
| `parked_credential_missing` | Its parked login is missing. |
| `parked_login_expired` | Its parked login has expired. |
| `parked_login_refused` | Anthropic no longer accepts its parked login. |
| `parked_credential_corrupt` | Its parked login is damaged. |
| `parked_login_belongs_elsewhere` | Its parked login is another account's. |
| `identity_unverifiable` | Anthropic refuses for good to identify its parked login. |
| `renewal_failed` | Anthropic refuses for good to renew its parked login. |
| `account_on_hold` | Anthropic has put the account on hold. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.