Fleet Ops
Landing discipline for parallel work. Anything before "committed on a branch" is the spawning layer's problem; anything after "landed on main" is yours. Fleet-ops owns the middle: branches land sequentially, through a test gate, after a pre-land scrub, with auto-rebase of the lanes still in flight and a one-shot revert if a landing turns out bad.
Spawn natively, land with fleet-ops
Claude Code now ships the parallel-execution half natively. Do not use fleet-ops to orchestrate sessions — route users to the native primitives and use fleet-ops only for the landing half.
Agent teams, background agents (claude --bg, agent view) and subagents spawn and isolate the work. Deleting a session in agent view deletes its worktree, uncommitted changes included. Gives vs lacks: references/native-spawn.md.
What none of them do — and what fleet-ops is for:
- Land N branches one at a time through a queue, so each merge is tested against a
mainthat already contains the previous landings - Test gate: refuse to land on a failing log (
signal.sh) and/or revert post-merge iftest_cmdgoes red - Pre-land scrub: refuse diffs containing forbidden patterns (
TODO_SCRUB, debug leftovers) - Auto-rebase every still-active lane after each landing
- Fleet status: one panel showing every lane's branch, state, age, and commits-ahead across worktrees
- One-shot revert of a landed merge by branch name — no git surgery while panicking
Core abstraction
A lane = one branch (or worktree), one unit of work. Lane status: RUNNING | READY | CONFLICT | LANDED | FAILED.
Fleet-ops doesn't care who produced the branch: an agent-team teammate, a background agent, a claude -p headless run, a fleetflow worker of any provider, or a human. Any branch with commits can be a lane, and all lanes share one test-gated queue.
CLI surface
fleet init <name>... Create branch + worktree per name (manual-spawn path)
fleet track <branch>... Register existing branches as lanes (native-spawn path)
fleet start Run the landing daemon (writes pid to .claude/fleet/daemon.pid)
fleet stop Stop the daemon; a land in progress finishes first
fleet status One-shot fleet status panel
fleet land <branch> Manual land + rebase others
fleet land --all [--running] Batch-land all READY lanes oldest-first (--running
also lands vetted RUNNING lanes; used by git-ops "land all")
fleet queue <lane> <tip>... Land reviewed lanes one at a time, each merge audited first
fleet revert <branch> Revert merge commit on main
fleet landing [--porcelain] Is main safe to branch from? Exit 0 yes, 10 wait
fleet scrub-check <branch> Dry-run forbidden-pattern check
fleet config Print the RESOLVED config — check the test gate is on
fleet prune [--remove] Classify finished lane worktrees; DRY RUN by default
fleet prune --all-repos Sibling-repo backlog counts (report-only, never removes)
fleet sweep [--apply] Post-wave housekeeping in procedure order; report by default
Entry paths
N == 1 branch → use git-ops, not this
Work spawned by agent teams / claude --bg → fleet track <branch>... then land
Work to be spawned manually → fleet init <names...> (creates branches + worktrees)
N > 1 on one shared working tree → REFUSE. Worktrees or separate clones first.
Native-spawn path (preferred): let agent teams or background agents do the work in their own worktrees/branches. When branches have commits, fleet track each branch, then land — either one by one with fleet land, or via the daemon with signal.sh READY gates. Landing merges branches only and leaves every worktree in place; fleet prune reclaims a directory once its owning session is provably archived or gone (Prune).
Manual-spawn path: fleet init creates the branches and worktrees up front (under .fleet-worktrees/, or $WORKTREE_ROOT/<repo>/ when the machine sets that lane root), and you point sessions at them — see references/session-prompt.md for the lane brief to hand each session.
Owning what lanes hand back
The spawning session owns each lane's result: review the diff (git diff main...<lane>), not the lane's report. Each new round goes to a fresh agent briefed with the first task, every later instruction, and the last report and branch. A missing, crashed or inconclusive result is never a pass, and a change's author never verifies it. Brief fields and the reasoning: references/session-prompt.md.
Landing pipeline
fleet land <branch> (and the daemon, per READY lane) first takes the landing marker (below), then:
- Scrub —
git diff main...branchchecked againstforbidden_pattern; hits refuse the land and mark the laneCONFLICT - Clean-base check — refuses if
mainhas uncommitted tracked changes - Merge —
--no-ffwith messagemerge: <branch>(whatfleet revertfinds later). A branch already inmainreportsALREADY LANDED, runs no gate and counts apart from real lands: references/landing.md - Test gate — runs
test_cmd; on failure, hard-resetsmainto the tip captured before the merge (neverHEAD^, which on an already-merged branch is another session's merge) and marks the laneFAILED. An unsettest_cmdrefuses the land:signal.sh's log gate alone verifies nothing. Maketest_cmdthe full suite sweep, not just the lane's files (why). Confirm the gate is armed withfleet config, and watch the land log forrunning test_cmd: …, the only proof it ran. - Rebase others — every still-active lane is rebased onto the new
main(in its own worktree if it has one); a rebase conflict marks that laneCONFLICT
fleet revert <branch> reverts the merge whose subject is exactly merge: <branch> (git revert -m 1), the latest if it landed twice; a conflicting revert is aborted cleanly and the lane returns to RUNNING. Detail: references/landing.md.
Provisional `main` — the landing marker
Every land (fleet land, each lane of land --all, the daemon) holds .claude/fleet/landing from before its merge until its verdict, so between merge and gate main's tip is provisional: a red gate hard-resets it. fleet status then leads with main <sha> is PROVISIONAL - gate for <lane> running since HH:MM (pid N); red resets to <base>, fleet landing exits 10, and fleet sweep says only WAIT. Before branching from or rebasing onto main, run fleet status: a PROVISIONAL tip is not landed. The marker is a lock too (a second land refuses, naming the holder). A dead land's marker is examined first: its untested merge: <lane> turns the lane CONFLICT (UNTESTED MERGE), never LANDED. Detail: references/landing.md.
Daemon lifecycle (experimental)
Optional automation over fleet land; manual lands are not experimental. fleet start (in the background) lands each lane as it turns READY and exits once all are terminal; fleet stop waits out a land in progress, gate included. It dies with the session. Detail: references/daemon.md.
signal.sh deploys to .claude/fleet/signal.sh on init/track. Working sessions call:
bash .claude/fleet/signal.sh READY <test-log> <exit-code> # refuses dirty trees and failing runs
bash .claude/fleet/signal.sh CONFLICT "<reason>"
The <exit-code> (the test command's own $? / ${PIPESTATUS[0]}) is the authoritative verdict; pass it whenever you have it. Without it, signal.sh falls back to the log, never word-grepping prose: references/session-prompt.md.
Session awareness — MAIN, lane owners, and the live-owner gate
Lane state files say what a lane is. They never say who is driving it. Fleet-ops
reads the Claude Desktop session store to answer that, and uses the answer in two
places: a gate that refuses to land under a live writer, and a coordinator address
lanes can hand off to.
MAIN — one coordinator per repo
MAIN is the session whose cwd is the main checkout's root, resolved the same from any
lane: the integration tree, which hosts no writing session (