/ainb-fleet:daemonsfrom ainb-fleet
Shows runtime health of four fleet daemons (phone bridge, notifyd, ATC, fleet daemon) in a table with state, PID, uptime, activity, errors, and health reason. Distinguishes clean stops from crashes.
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.
The runtime-health answer for the fleet's four background daemons. Reads the
on-disk liveness signals each daemon already maintains and renders one typed
row per daemon. The same aggregator (fleet::daemons::collect) backs the TUI
Daemons screen, so the CLI and the TUI can never drift.
This is the question ainb fleet bridge status could never answer: that verb
reports only install state. daemons reports whether the process is
actually running and serving right now — a crashed-but-installed bridge
shows stopped with a stale-heartbeat reason here.
| daemon | id | how it's probed |
|---|---|---|
| phone bridge | bridge | heartbeat file (~/.agents-in-a-box/daemons/bridge.json) + pid-identity cross-check |
| notifyd | notifyd | PID-file liveness + bound Unix socket + sqlite DB file present |
| ATC | atc | mode-dependent: in full, the most-recently-beating instance's heartbeat-state.json (timer-driven; no resident pid); in lite, the scan loop's own heartbeat + pid |
| fleet daemon | fleet-daemon | heartbeat file + pid-identity cross-check — conditional row, see below |
Rows are emitted in this exact order (bridge, notifyd, ATC, then the fleet daemon when it has a row), even when every daemon is stopped — so "everything stopped" is a legible table, never an empty one.
The fleet daemon is a conditional row. ATC is the fleet's supervisor and the standalone daemon is what it replaced, so a permanently-stopped row for it presented the two as a choice — the competing control path the supervisor exists to remove, still on the screen you read to see who is running. It is therefore listed only when it is NOT stopped.
That is deliberately not "always hidden". A daemon that is up got there through
--force-race, which means two controllers really are auto-continuing the same
panes and ATC's per-session retry cap cannot hold. That row appears, reports
degraded, and its reason opens with RACING ATC. Hiding it would make the one
state you most need to see the only one the screen does not show.
The row is only a display decision: ainb daemon fleet-daemon start|stop|restart
keeps working whether or not a row is drawn.
ainb fleet daemons # fixed-width text table (default)
ainb --format json fleet daemons # typed rows for scripting
--format is a global flag — it goes before fleet. There are no other
flags or subcommands; daemons is a pure read.
DAEMON STATE PID UPTIME LAST ACTIVITY ERRORS HEALTH
● running · ○ stopped · ? unknown.- for ATC (timer-driven).5s, 12m, 3h, 2d); - when unknown.5s ago, just now).Telegram (@bot) — running + connected); otherwise the reason string,
which is the load-bearing field for telling a clean stop from a crash.state + reason)| state | reason examples | meaning |
|---|---|---|
running | running + connected, running (connecting…), running but socket not bound yet | process alive and heartbeating / serving |
stopped | no heartbeat — not running this session, stale heartbeat — pid 4242 not alive (crashed), stale heartbeat — pid 4242 recycled (different process, crashed), stale heartbeat — last beat 130s ago (wedged?), no ATC instance provisioned, N instance(s) provisioned, all heartbeat-disabled | not serving — the reason says clean-stop vs crash vs never-configured |
unknown | (probe error) | the probe itself failed to read a signal — surfaced rather than guessed |
| field | meaning |
|---|---|
kind | bridge | notifyd | atc | fleet-daemon |
state | running | stopped | unknown |
pid | OS pid when known (omitted otherwise) |
uptime_ms | ms since start when known |
connected | daemon-specific connection health (Telegram online / socket+db reachable / heartbeat alive) |
channel | connection label, e.g. "Telegram (@bot)", "unix socket + sqlite", "tower (every 15m)" |
last_activity_at | epoch ms of last real activity when known |
error_count | errors observed this run |
last_error | most recent error string when known |
reason | short human explanation of the state (clean-stop vs crash vs never-configured) |
A daemon's heartbeat records both its pid and its process started_at.
Bare liveness (kill(pid, 0)) is not trusted: when a daemon dies and the
OS hands its pid to a different, unrelated process, that pid is alive but is
no longer our daemon. The probe cross-checks process identity — the
heartbeat's started_at against the live process's real OS start time — so a
recycled pid classifies as stopped (reason: pid … recycled (different process, crashed)), never a false running. A dead pid is caught immediately
regardless of how recent the heartbeat looks; a live-but-wedged pid whose beat
went quiet past the 90s staleness window reports stopped with a wedged?
reason.
For notifyd specifically, "connected" requires an actually-bound Unix
socket (a non-blocking connect() that a listener accepts) — not merely a
notify.sock file on disk, which a crashed daemon can leave behind. The DB is
reported as "file present", honestly not "reachable", since exists() does
not prove the sqlite file opens and accepts writes.
# Any daemon not running?
ainb --format json fleet daemons | jq '[.[] | select(.state != "running")]'
# Is the bridge connected to a chat channel right now?
ainb --format json fleet daemons | jq '.[] | select(.kind=="bridge") | {state, connected, channel, reason}'
# Surface any crash reasons in one line each
ainb --format json fleet daemons | jq -r '.[] | select(.reason | test("crash|stale|wedged")) | "\(.kind): \(.reason)"'
daemons never starts, stops, or restarts anything — it only
reports. To manage a daemon, use its own verb (ainb fleet bridge install/uninstall, ainb fleet atc setup/teardown, ainb fleet daemon).$AINB_HOME. It always uses ~/.agents-in-a-box; the
probe mirrors that so it reads the same files notifyd writes (a set
$AINB_HOME is only honoured for an isolated test run).channel label. Heartbeat-disabled
instances are never counted as running, even with a recent leftover beat.channel names the supervisor mode — tower · FULL(claude) · every 15m or tower · LITE · no LLM. A lite instance has no scheduler and
no brain session, so it is probed by its scan loop instead; one provisioned in
lite with no scanner running reads degraded (the fleet has a designated
owner and that owner is absent), not stopped.ainb fleet atc mode <name> --set <mode> performs — the screen
shells that verb rather than reimplementing the stop-then-start ordering.What SKILL.md sets; muted values are Claude Code's defaults
12 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.
npx claudepluginhub stevengonsalvez/agents-in-a-box --plugin ainb-fleetOther plugins' skills for the same job