Ainb fleet

From stevengonsalvez/agents-in-a-box · View interactive version

Ainb fleet is an AI agent skill from the GitHub repository stevengonsalvez/agents-in-a-box. Fleet orchestration overview — the `ainb fleet ...` Rust subcommand namespace for driving every claude session on the host. Routes to the sub-skills (ainb-spawn / standup / broadcast / sequence / needs / daemon / atc). Invoke this for an at-a-glance map of what fleet can do; reach for the specific s

How to use this skill

Skill file

ainb fleet — overview

Single Rust binary (ainb) provides orchestration verbs across every

claude session running on this host. Each verb has its own colon-namespaced

sub-skill with focused docs.

Verbs

| sub-skill | what it does |

|---|---|

| CODE0 | Spawn a session correctly with ainb run (always into a worktree, and the --parent shapes that silently misfire) |

| CODE0 | List every claude session — merged across ainb · peers · bg jobs |

| CODE0 | Send one prompt to selected sessions |

| CODE0 | Ordered multi-step prompts, ack-gated between steps |

| CODE0 | Show sessions blocked on input / errors / waiting |

| CODE0 | Air Traffic Control — the persistent brain: watches the fleet on a heartbeat, auto-clears safe sessions, escalates the rest to your phone |

| CODE0 | Background auto-continue watcher (superseded by ATC for managed fleets) |

ATC is the orchestrating brain that drives the other verbs on a schedule. The

verbs are its hands/eyes; the phone bridge is its voice

to you. Reach for ATC when you want unattended, policy-driven fleet supervision;

reach for the individual verbs for one-off actions.

Architecture (1-line)

discover (ainb + peers + jobs)  ──▶  state read  ──▶  send (tmux-first, broker fallback)

Global flag

--format json|text|csv|markdown (default text). Prefer --format json

when an LLM is the consumer.

Transport — tmux is primary

Writes (broadcast / sequence / daemon / answer-routing) go out over **tmux

send-keys by default**. The claude-peers broker is opt-in / fallback only,

because in practice it has proven flaky (silent delivery gaps). The primitives

the fleet uses are exactly: tmux send-keys -l (write), `tmux capture-pane -p

-S -<n>` (read, incl. scrollback), and the session JSONL transcript

(~/.claude/projects/<cwd-slug>/<sid>.jsonl) as ground-truth read.

Select the write channel with AINB_FLEET_TRANSPORT:

| value | behaviour |

|---|---|

| unset / tmux / tmux-first | tmux send-keys first, broker fallback (default) |

| tmux-only | tmux send-keys only — never touch the broker |

| peers / broker / peers-first | legacy: broker first, tmux fallback |

            ┌──────────────┐  tmux send-keys -l   ┌─────────────┐
  send ────▶│ tmux pane?   │─────────────────────▶│  delivered  │
            └──────┬───────┘                       └─────────────┘
                   │ no live pane (or peers-first)
                   ▼
            ┌──────────────┐  broker /send-message ┌─────────────┐
            │ peer + broker│──────────────────────▶│  delivered  │
            │   healthy?   │                        └─────────────┘
            └──────────────┘

Discovery sources

Discovery is independent of the write transport — peers are still read for

visibility (PID, summary, WAITING: markers) even when writes go via tmux.

read directly from its sqlite (no HTTP), so discovery survives a down broker

Merged + deduped by cwd so the same session in two sources collapses

into one record with sources: ["ainb", "peers"].

Environment overrides

| var | default | use |

|---|---|---|

| AINB_BIN | ainb | override binary the discover layer shells to (tests) |

| AINB_FLEET_TRANSPORT | tmux-first | write channel: tmux / tmux-only / peers |

| AINB_FLEET_PEER_ID | ainb-fleet-cp | from-id used when a write does fall back to the broker |

| AINB_FLEET_JOBS_DIR | ~/.claude/jobs | bg-job scan root |

| CLAUDE_PEERS_DB | ~/.claude-peers.db | broker sqlite path (discovery) |

| CLAUDE_PEERS_PORT | 7899 | broker HTTP port (fallback writes only) |

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.