Fleet restore

Resume every agent terminal after a restart: what fleet restore does, how panes are matched, what it will not do, its flags, and its requirements and limits.

Fleet restore

Restart your computer without losing your team

1Before

Click Prepare for restart in the Command Center and wait for "Safe to restart".

2Restart

Restart the computer. Let iTerm2 reopen its windows.

3After

Run claudelink restore, check the preview, then claudelink restore --go.

What it is

Restarting the computer ends every agent session. Bringing a fleet of terminals back by hand means finding each session id, resuming it in the right pane, and telling each agent who it is. Fleet restore does that with one command. It is available from v1.6.13.

While the Command Center runs, it writes ~/.claudelink/fleet-snapshot.json about once a minute: for each agent, its Claude Code session id, its folder, and the iTerm2 pane it sits in. The snapshot keeps the last known entry per role, so a restart does not erase it.

Fleet restore works with iTerm2 only and with Claude Code sessions only. See Requirements and limits before you rely on it.

Before a restart

Click Prepare for restart in the Command Center header. Each agent is asked to update its handoff and confirm. The status line shows who has confirmed, for example "9 of 11 ready", and a terminal the prompt could not reach is listed as Not reached, with a Retry not reached button. Restart when the status line says "Safe to restart".

Command Center header with the Prepare for restart button and a status line reading 9 of 11 ready, waiting on two agents

After a restart

Let iTerm2 reopen its windows, then run these from any shell:

claudelink usage --on        # only if you use the Plan Usage meter (see below)
claudelink restore           # preview: which session goes into which pane. Types nothing.
claudelink restore --go      # resume them

Without --go, restore only prints the preview and types nothing. With --go, it types the resume command into each matched pane, waits for Claude to start, then types a prompt asking the agent to register under its role, read its handoff, and resume. It then confirms that the registration arrived.

What follows the role across the restart

(v1.6.17+) Unread messages sent to an agent before the restart are delivered to it when it registers again, and the register result says how many were carried over. A role also keeps the settings it last registered with: an agent that registered with autonomousReply: false stays that way when it registers again without the option.

With or without the Plan Usage meter

(v1.6.15+) Restore works either way. The preview always shows the exact command it would type.

Your setupResume command typedWhat you get
Plan Usage never set upclaude --resume <id>Every session back, same conversation. No quota readings in the Command Center.
Plan Usage set up, proxy runningclaude-metered --resume <id>Every session back, and each one feeds the Plan Usage tile.
Plan Usage set up, proxy not running (the usual state right after a reboot)nothingRestore stops and tells you. Run claudelink usage --on and try again, or add --plain to resume without the meter this time.

The third case stops on purpose: typing plain claude there would quietly take every terminal off the meter. A session resumed with --plain is not metered until you quit it and resume it with claude-metered --resume <id>; nothing else about the session differs.

A preview looks like this (names are examples):

Fleet restore preview (dry run, nothing is typed).

HIGH      Backend Developer
          session 4c1e09a2  folder ~/Projects/api-service  seen 6 min ago
          -> pane /dev/ttys003 (pane-id)
HIGH      Web Developer
          session a83f5d17  folder ~/Projects/website  seen 6 min ago
          -> pane /dev/ttys002 (pane-id)
HIGH      Docs Writer
          session 0b92e6c4  folder ~/Projects/docs  seen 6 min ago
          -> pane /dev/ttys007 (pane-id)

Panes left alone:
          /dev/ttys004  ~/Projects/api-service

Terminals start one at a time, three per batch (set with --batch N), and iTerm2 must be answering before each keystroke. Starting every session at once on a freshly booted machine made iTerm2 drop keystrokes, which is why the run is paced. A fleet of eleven takes a few minutes.

How panes are matched

Each agent is matched to a pane in this order:

  1. The iTerm2 pane id. iTerm2 keeps pane ids across a restart when it restores its windows.
  2. The folder, when one agent and one pane share it.
  3. Pane order, when several agents share a folder in one window. This match is marked medium and is skipped unless you pass --allow-medium.

An agent with no unambiguous pane is listed as UNMATCHED, and nothing is typed for it.

What it will not do

  • Type into a pane that is not at a shell prompt. A pane already running something is skipped, which also makes the command safe to run a second time.
  • Guess. Uncertain matches are skipped and reported.
  • Type a value it has not checked. The role name, session id, and folder are typed at a shell prompt, so each must match a strict shape or that agent is skipped.
  • Retype blindly. If a keystroke times out, the pane is read first: an empty prompt is retyped, a command left unsubmitted gets Enter only, and anything else is left alone.

Flags

FlagEffect
--goAct on the preview. Without it nothing is typed.
--only "Role A,Role B"Limit to the named roles.
--allow-mediumInclude matches made by pane order.
--batch NTerminals started before each pause (default 3).
--plainResume with plain claude, without the Plan Usage meter (v1.6.15+).

Requirements and limits

  • iTerm2 only. iTerm2 must be set to restore its windows at launch.
  • Claude Code sessions only.
  • The metered resume command needs the claude-metered shell function from the Plan Usage setup in the ClaudeLink README. Without Plan Usage, restore types plain claude --resume (v1.6.15+).
  • Matches made by pane order are skipped unless you pass --allow-medium.
  • Testing so far: it has been tested on one real restart of a fleet. Before pacing was added, the first run resumed 8 of 11 terminals and a second run resumed the rest. The paced version has been run on a few terminals, and not yet on a full fleet after a restart.

The state it reads is listed on the configuration page, and the commands on the CLI reference.