# Take turns on several accounts

> Add more Claude or Codex accounts to a machine, and let the rota extension start each agent's run on the account with the most room left.

When your agents work all day, one account's limits run out. The **rota** extension keeps track of
several accounts on a machine and takes them in turns: each run the node starts goes on the account
with the most room left.

## Add rota and a second account

On the machine:

```bash
pointman add rota
```

Rota starts within about ten seconds. `pointman add rota --node studio` adds it on another
machine's node instead.

Until rota has an account besides the machine's own sign-in, the apps ask for one, on **Machines**
and in **Needs you**. Tap **Add** on Machines, or type `/rota add` in any thread, and give the
account a label, such as `work`. Then sign it in:

1. Tap **Sign in**. Rota runs `claude setup-token` on the machine, and the app opens the sign-in
   page it gives. **Open the sign-in page** opens it again, and the link works on any other phone
   or computer too.
2. Sign in as the other account. The page shows a code: paste it into the app and tap **Send the
   code**.
3. The machine turns the code into the account's token and stores it in the vault as `rota.work`,
   sealed for your machines. The sheet closes with "Signed in: rota.work v1 is in the vault".

Nobody sees the token, you included. A sign-in nobody finishes stops after 10 minutes, and one that
fails says why, with **Start again**.

Or paste a token under **Or paste one**: run `claude setup-token` on any computer, signed in as the
other account, and paste the token it prints. The app seals it in the vault the same way.

Rota picks a new account up within a minute. Add as many as you like. See
[Give an extension what it needs](/guides/extensions/#give-an-extension-what-it-needs).

## How it picks

- **Runs stay put** on the account they're on, so its cache stays warm, until either of its windows
  (the 5-hour one or the weekly one) passes 90%.
- **Then new runs move** to the account with the most room, if it's at least 10 points emptier.
- **A cooldown** keeps runs off the account they left for 10 minutes, even if it looks fine again,
  unless nothing else can take them. An account that can't take runs leaves the pool at once.
- **A run that hits its limit partway** carries on, on another account.
- **Limits come from Claude Code itself:** each run reports its account's windows when it ends. An
  account nothing has run on for 30 minutes is checked with a one-line run on that account.

The machine's own sign-in counts as an account too, called `default`.

## See where runs start

On a machine's page in **Machines**, each Claude account has a bar for its 5-hour window and one for
its week, with when each resets. They turn warm, then red, as they near rota's threshold. The
account runs start on is marked, with since when and why ("since 14:05, default was at 97%").

From there you can steer it too: **Start Runs Here** moves new runs to an account, **Keep Runs Off
It** holds one (**Put It Back** undoes it), and **Swap Now** moves to the account with the most
room.

`pointman health` shows the same on one line per account:

```text
5h 46% (resets 14:30) · week 37% (resets Tue 03:00) · runs start here
```

Agents have a `rota_status` tool that shows the same.

## Steer it

Agents ask with [`run_on_machine`](/reference/mcp-tools/#run_on_machine); `rota_swap` is a tool of
its own, so an agent can move before a long job.

| Command | What it does |
|---|---|
| `rota.swap {to}` | New runs start on that account now, and stay until it's full. With no account, the one with the most room. |
| `rota.hold {account, held}` | Keep runs off an account, or let them back on with `held: false` |
| `rota.agent {agent, account}` | An agent's runs start on that account while it has room. No account: the agent follows the rule again. |
| `rota.folder {folder, account}` | The same for every agent working in a folder. An agent's own account wins over its folder's. |
| `rota.status` | Every account, its windows, and the last 10 moves with why |

## Change the rules

Rota's settings go in the machine's `agent.toml`:

```toml
[extension_settings.rota]
threshold = 90          # move new runs off an account once either window is this full (%)
cooldown_minutes = 10   # how long runs stay off an account they moved away from
check_minutes = 30      # how often an idle account is checked
```

## Codex accounts

Rota takes Codex accounts in turns too. Add one on the machine, in rota's folder
(`~/.local/share/pointman/extensions/rota/<version>`):

```bash
python3 -m rota codex add work
```

That makes the account a Codex home of its own and runs `codex login` in it. Each Codex run then
gets the picked account's home as `CODEX_HOME`, by the same rule. Swapping and holding are for
Claude accounts only for now.

:::note[Coming soon]
Gemini accounts.
:::
