/agent-fleet:agent-fleetfrom agent-fleet
Use when running several autonomous Claude Code agents in parallel (one per platform, area or ticket) in tmux on a local or remote host, supervised from this session. Covers setting up the fleet (fleet.conf, prompts, autonomy rule), starting agents, the watchdog, the supervisor Monitor, relaying the owner's decisions, verifying agent claims, handing the supervisor role to a new session before its context fills up, and advisor sessions. Triggers include "start agents per platform", "supervise the agents", "watchdog", "hand off supervision", "become an advisor", "fleet".
Ships in agent-fleet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Three layers, each with one job:
| Layer | Runs where | Job |
|---|---|---|
| Agents | tmux sessions on the agent host, claude -n "<title>" $CLAUDE_ARGS | Deliver their scope. Use phased-delivery inside each agent. |
| Watchdog | tmux <FLEET>-watchdog on the agent host, scripts/watchdog.sh | Every 60 s: idle nudge, stall nudge then replace, recreate missing sessions, deny permission dialogs, low-disk warning, context rotation at CTX_MAX%, exit at END_AT. |
| Supervisor | This Claude session (usually on the owner's Mac) | Monitor the watchdog log, act on events, relay the owner's decisions, verify claims on primary sources, keep the handoff file current, rotate itself to a new session at ~700k context. |
Advisors are earlier supervisor sessions that handed over. They answer questions and send unprompted notes to the supervisor. They do not touch the host or the agents unless the supervisor or the owner asks.
scripts/fleet is the CLI for everything below. Run it from the fleet dir (the one holding fleet.conf) or set FLEET_CONF. The plugin root is two levels above this file. Call the CLI as <plugin root>/scripts/fleet.
fleet init <dir> creates fleet.conf, autonomy.txt, idle-nudge.txt, ctx-handoff.txt, agent.example.txt. Use a dir outside any repo checkout, e.g. ~/Development/<project>/<fleet>-fleet/.fleet.conf: host access (REMOTE_SSH, REMOTE_USER), FLEET_DIR on the host, AGENT_CWD, END_AT, and one AGENTS row per agent (an agent with its own folder, arguments or kind (claude or dsh) gets an agent_overrides branch, README "Per-agent folder, arguments and kind"). Ask the owner for anything you cannot read from the environment. Do not guess host, user or end time.agent.example.txt: scope, docs to read, host facts you checked yourself, the phased-delivery repo profile, and the other agents' session names.autonomy.txt with the owner. Never widen it on your own. That file is appended to every start and every replacement prompt.fleet sync, then fleet watchdog dry and read the output. Sync refuses when a host file was edited since the last sync: fleet pull <file> and merge, or fleet sync --force. Every agent should show state=dead or missing (nothing started yet) and the output should have no bash errors.claude once by hand in AGENT_CWD on the host and answers Claude Code's workspace trust question. Trust is the owner's decision. The plugin never answers it, and fleet start fails fast with "workspace trust dialog" until it is done.fleet start, then fleet status. A failed start prints start FAILED: <reason> and exits non-zero. Then fleet watchdog start.HANDOFF.md in the fleet dir using references/handoff.md. It is the contract any later supervisor reads first.No cron or launchd entry unless the owner asks for one explicitly. After a host reboot, fleet watchdog start and fleet start bring it back.
Arm a Monitor with the output of fleet monitor-cmd, timeout 30 min, and re-arm it every time it expires until END_AT. Details and the event table are in references/supervise.md. Short form:
state=stalled, state=dead, REPLACED, START FAILED, REPLACE FAILED, DENIED, dialog (kind=trust waits for the owner), LOWDISK, missing, CTXROTATE, end time, and any ssh error (Timeout, Connection closed).working / tool / waiting changes: one line or nothing.gh pr view --json headRefOid,statusCheckRollup, git ls-remote, the check run, the exit code.To watch an agent live, fleet attach <session>. The fleet runs on its own tmux server (tmux -L fleet-<FLEET>), so plain tmux ls and tmux attach do not see it. Local and remote fleets work the same way; only REMOTE_SSH in fleet.conf differs.
Write the message to a local file, then fleet send <session> <file>. It refuses to paste when a permission dialog is open (exit 3) or there is real typed text in the input line (exit 4). It refuses a blank file (exit 6) and a message that quotes permission or trust dialog text (exit 8, reword it), stops before Enter if a dialog or typed text shows up during the paste, and confirms delivery by finding the first non-empty line in the pane (exit 5 if missing, exit 7 if a tmux call failed). fleet broadcast <file> sends one file to every agent and prints one line per agent. Rules:
autonomy.txt ("resolve it from the worklog, record it as an agent decision"). Do not invent the answer.fleet decide "<text>". It adds the next numbered rule to autonomy.txt, syncs it, and broadcasts it, so replacements inherit it.Do this when your own context nears the auto-compact limit. Start at about 700k when auto-compact is at 800k. The owner may also ask for it at any time. Follow references/handoff.md:
fleet handoff <next> to draft HANDOFF-<next>.md with live data, then fill in its empty sections.ListAgents.Never leave a gap in monitoring, and never have two sessions writing to the agents at once.
After handing over you are an advisor. Answer the supervisor's questions from your history and transcript. Send short unprompted notes when you spot a risk, and back each note with evidence you checked yourself. Relay the owner's new decisions from your chat to the supervisor immediately. Do not touch the host or the agents.
references/supervise.md: the Monitor, the event table, verification and common incidents.references/handoff.md: the HANDOFF file structure and the supervisor rotation protocol.references/watchdog.md: what the watchdog detects, its limits, and how to test a change to it.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kolezka/agent-fleet --plugin agent-fleet