/ainb-fleet:needsfrom ainb-fleet
Enumerates all blocked Claude sessions waiting on user answers, API retries, idle turns, or WAITING markers. Returns rich JSON with signal kind and context per session.
Ships in ainb-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.
None: SKILL.md is the whole skill.
Single place to see every claude session that wants your attention. Four signal kinds classified per session, priority ASK > ERR > IDLE > WAIT.
needs vs fleet-needs — which skill?This skill (
needs) is the plain, always-available control panel. It is prompt-driven: render the HUD, fire AskUserQuestion, route answers back. It needs no workflow gate and works everywhere.
/ainb-fleet:fleet-needsis the workflow-backed "Jarvis" cockpit — same purpose, but it runs the deterministichangarworkflow (verb=needs) for discover→enrich→prioritize, batches enrichment in a single agent, and adds key-route ASK answering (presses the target's picker keys via tmux for an open AskUserQuestion). It requiresCLAUDE_CODE_WORKFLOWS=1; with the gate off it falls back to this skill.Rule of thumb: reach for
fleet-needswhen the workflow gate is on and you want the batched/cockpit path; otherwise useneeds. Both read the same underlyingainb fleet needsdata, so the panel content is identical.
current_state (hooks), tmux fallbackainb fleet needs reads the event-sourced read model first. Claude Code
hooks append lifecycle events to events.jsonl; notifyd ingests them into a
SQLite current_state table that materializes the latest stage per session
(ASK / ERR / WAIT / IDLE / RUNNING / DONE). For each session (keyed by cwd —
the fleet's cross-source dedupe key), the reader resolves one of three ways:
| resolution | when | what happens | row source |
|---|---|---|---|
| hook-authoritative | a materialized ASK/ERR/WAIT/IDLE row exists for the cwd (source = hook) | use it directly — no pane scan | "hook" |
| hook-healthy | the hook says RUNNING / DONE | not a "need" — emit nothing, skip the pane scan | — |
| fallback | no usable hook row — absent from current_state (a non-Claude session like Codex/Gemini fires no Claude hooks), source = tmux, or a stale row | run the live classify() pane/transcript scan, exactly as before the event store existed | "tmux" |
So a Claude session's ASK/WAIT/IDLE/ERR is learned primarily from hooks; the tmux pane scan is the fallback for non-Claude agents (Codex/Gemini) and for sessions the daemon hasn't materialized. The read-time merge IS the tmux / non-Claude fold — each session yields at most one row, never double-listed.
The source field ("hook" | "tmux") on each row tells a consumer which
path produced it. ASK/ERR/WAIT/IDLE are sticky states the materializer only
changes on a new event, so an aged row is normally still the truth and there is
no staleness check by default. Override only when you have an independent
reason to distrust an aged row: AINB_FLEET_STATE_STALE_MS=<ms> (default 0 =
no age check). When notifyd is down or the hooks were never installed,
current_state is empty and every session falls back to the live scan, so
the panel still works.
This skill does NOT install hooks. It only consumes the materialized state. The global Claude Code hooks are installed by
ainb fleet atc setup(into~/.claude/settings.json).
ainb fleet needs # text Jarvis-HUD layout
ainb --format json fleet needs # structured JSON (preferred by LLM)
ainb fleet needs --idle-min 10 # override idle threshold (default 5 min)
Env override: AINB_FLEET_IDLE_MIN=10.
Each row in the output array:
{
"session": {
"id": "…",
"cwd": "/Users/…",
"tmux_session": "tmux_…",
"workspace_name": "…",
"peer_id": "…", // null if not broker-registered
"sources": ["ainb", "peers"],
"summary": "…", // JSONL-derived (see standup)
"last_seen_ms": 1779…
},
"kind": "ASK" | "ERR" | "IDLE" | "WAIT",
"context": {
// shape depends on `kind`:
//
// ASK — structured AskUserQuestion pulled from JSONL tool_use:
"question": "…",
"header": "…",
"options": [ { "label": "…", "description": "…" } ],
"multi_select": false,
//
// ERR — API error matched in pane:
"pattern": "rate_limited",
"snippet": "…API Error · rate_limited · …",
//
// IDLE — assistant turn-end, no user follow-up, > N min ago:
"idle_minutes": 17,
"last_assistant_text": "…",
//
// WAIT — explicit WAITING: prefix in peer summary:
"marker": "WAITING:",
"text": "…the post-marker text…"
},
"route_hint": "tmux" | "broker" | "none", // advisory; send is tmux-first
"source": "hook" | "tmux" // provenance: event-sourced row vs live tmux/transcript scan
}
source distinguishes a hook-sourced need (materialized from events.jsonl)
from a tmux-folded one (the live fallback scan for non-Claude agents / un-
materialized sessions). It is additive — older consumers that ignore it still work.
Each row also carries three enrich fields:
| field | meaning |
|---|---|
enrich_key | content hash of the card; the producer's cache key |
enriched | a fresh cached suggestion (free) — render it as-is |
need_enrich | true only when there is no cache entry and enrichment is on |
Draft the missing ones by COUNT, never one subagent per session:
stale = rows where need_enrich == true
stale == 0 ─▶ render cached/snippet only (0 tokens)
stale ≤ 6 ─▶ draft inline in THIS session (0 subagents)
stale > 6 ─▶ /ainb-fleet:fleet-needs workflow (1 batched agent)
Cutoff: AINB_FLEET_ENRICH_INLINE_MAX (default 6). When you draft inline,
persist each so the next read is free:
ainb fleet enrich-cache put --key "<enrich_key>" --suggestion "<text>"
ainb fleet needs --no-enrich (or AINB_FLEET_ENRICH=0) skips all of this —
cached suggestions still render, nothing new is drafted, 0 tokens.
The calling LLM session should render this exact layout in chat:
╔════════════════════════════════════╗
║ ⚡ FLEET STATUS · N NEED YOU ⚡ ║
║ 🔴 X err 🟡 Y ask ⚪ Z idle ║
║ highest priority: <session> (<KIND>) ║
╚════════════════════════════════════╝
▸ 🟡 <session> ─ <question text>
① <option label>
② <option label>
③ <option label>
▸ 🔴 <session> ─ <pattern> (<snippet>)
▸ ⚪ <session> ─ idle <N>m
'<last assistant snippet>'
▸ 🟢 <session> ─ WAITING: <text>
Rules:
▸ prefix, signal emoji, em-dash separator+ N moreAfter rendering the HUD, fire AskUserQuestion per session that wants an answer. Each kind maps to a different prompt shape:
| kind | AskUserQuestion shape |
|---|---|
| ASK | Relay options 1:1 from context.options |
| ERR | " hit <pattern> — retry? skip? investigate?" |
| IDLE | " idle m after: '' — resume? close? other?" |
| WAIT | " says: <marker> <text> — answer:" |
For ASK kinds, the LLM session SHOULD use AskUserQuestion's structured options so the user can click rather than type.
Writes are tmux-first. Prefer driving the target pane directly — it lands
reliably and is verifiable with capture-pane:
# default, most reliable: write keystrokes straight to the pane
tmux send-keys -t "<tmux_session>" -l "<answer>"
tmux send-keys -t "<tmux_session>" Enter
# verify it landed
tmux capture-pane -t "<tmux_session>" -p -S -40 | grep -F "<answer>" && echo "✓"
Or go through the verb, which honours AINB_FLEET_TRANSPORT (tmux-first):
ainb fleet broadcast "<answer>" --filter "<exact tmux_session>"
route_hint is advisory — it mirrors the default tmux-first order:
tmux — a live tmux pane exists → tmux send-keys -l (the normal case)broker — no tmux pane, but a healthy broker peer → claude-peers HTTP fallbacknone — bg job or no targets; can't auto-route; tell user manuallyout=$(ainb --format json fleet needs)
# 1. Render the HUD in chat (LLM does this from the JSON)
# 2. For each entry, fire AskUserQuestion (claude code session does this)
# 3. After each answer:
echo "$out" | jq -r ".[] | select(.session.tmux_session == \"$picked\") | .session.tmux_session" \
| xargs -I% ainb fleet broadcast "$answer" --filter "%"
--idle-min or env var.summary to start with WAITING:. Most sessions never do.ainb status <job> for those.current_state table FIRST (hook-sourced ASK/ERR/
WAIT/IDLE per session); the live tmux/transcript classify() scan is now the
fallback for non-Claude agents (Codex/Gemini) and un-materialized sessionssource field ("hook" | "tmux") to each rowAINB_FLEET_STATE_STALE_MS (default 0 = no age check) to optionally distrust aged rowsainb fleet atc setup, NOT by this skill--idle-min flag + AINB_FLEET_IDLE_MIN env overridecontext polymorphic per kindroute_hint field to guide answer-routingWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub stevengonsalvez/agents-in-a-box --plugin ainb-fleet12 skills in this plugin
/ainb-fleetFleet 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 sub-skill for the verb you want.
/ainb-spawnainb-fleet:ainb-spawnSpawn a coding-agent session correctly with `ainb run`: always into a git
worktree, never bare into a plain checkout. Use whenever you are about to
start a Claude/Codex/Gemini/Copilot session in a terminal. Guards the
invocations that silently produce a `(broken)` workspace row, two agents
sharing one working tree, a `--parent` flag that never fires, or a teardown
that cancels itself and leaks the session.
/atcainb-fleet:atcATC (Air Traffic Control) — the single operator-visible fleet supervisor, in
exactly one mode: `lite` (no LLM: deterministic scan, known-transient retry
policy, safety caps, evidence) or `full` (the persistent orchestrating brain).
Full mode is a plain `ainb` session (Claude or Codex) running a generated
policy, woken on a heartbeat (default 15 min) built from the LLM-free `fleet needs`
read — which is itself HOOKS-PRIMARY (event-sourced): ATC learns ASK/WAIT/IDLE
from the materialized `current_state` table, not by scraping panes, with a
tmux fallback for non-Claude agents. `atc setup` installs the global Claude
Code hooks into ~/.claude/settings.json. It auto-clears the safe/blocked
sessions via the fleet verbs (confident ASK → broadcast; ERR → continue within
a retry cap) and escalates the uncertain ones to the phone bridge. Supersedes
the `daemon` skill for managed fleets. Use to provision / inspect / tear down
an ATC instance, or to switch which controller owns the fleet.
/bridgeainb-fleet:bridgeNative phone bridge — relay messages two-way between a chat channel
(Telegram, Slack, and/or Discord) and your ainb sessions. Inbound chat
messages route to a target session (by `name:` prefix, else a conductor-
first default) and are delivered via tmux send-keys; the session's reply is
captured from its JSONL transcript and sent back to the chat. Config lives
in ~/.agents-in-a-box/config/config.toml under [fleet.bridge.*]; tokens
resolve from $ENV / keychain refs and are NEVER passed on argv. Use to run,
install, or check the bridge — this is the channel ATC pages you through.
/broadcastainb-fleet:broadcastFan out a single prompt to selected claude sessions across the fleet.
Use when you need to apply the same instruction (e.g. `/clear`,
`git pull`, `remote-control disconnect`) to many sessions at once.
Routing: tmux send-keys by default (the broker is an opt-in fallback,
toggled via AINB_FLEET_TRANSPORT). Refuses to run without an explicit
targeting flag (--all, --filter <regex>, or --cwd <substring>) — no
implicit fan-out.
/costainb-fleet:costShow fleet spend — per-session, per-model, per-day, and per-group USD
cost rollups for every claude/codex session, sourced live from ainb's
burndown analytics (which already prices every provider call). Use when
you need spend visibility across a multi-session fleet, want to find the
most expensive session/model, or are checking whether any session/group
has crossed a configured budget cap. Budget breaches are also delivered
as notifyd alerts.
Default output: text tables. Pass --format json for LLM consumption.
Other plugins' skills for the same job