plugins/ainb-fleet/skills/daemon/SKILL.md
Long-running watcher that scans every claude session every 5s and auto-sends `continue` to any session whose recent tmux pane buffer matches a known API-error regex (rate_limited, overloaded_error, internal_server_error, request_timeout, socket_hang_up, fetch_failed, ECONNRESET). Use this when you want unattended recovery from transient API failures across the fleet.
npx skillsauth add stevengonsalvez/agents-in-a-box ainb-fleet:daemonInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Background watcher. Registers as peer ainb-fleet-cp. Auto-continues
sessions hitting API errors.
ainb fleet daemon # quiet
ainb fleet daemon --verbose # log every detection + send
For real background use:
nohup ainb fleet daemon --verbose > ~/.ainb-fleet.log 2>&1 &
tmux capture-pane -p -S -80 (last 80 lines).continue to that session via the
standard route (peers-first, tmux fallback).| name | regex |
|---|---|
| rate_limited | \brate[_ ]limited\b |
| overloaded | \boverloaded_error\b \| \bModel is overloaded\b |
| internal_server_error | \binternal_server_error\b |
| request_timeout | \brequest timed out\b |
| socket_hang_up | \bsocket hang up\b |
| fetch_failed | \bAPI Error\b \| \bfetch failed\b |
| connection_reset | \bECONNRESET\b \| \bconnection reset\b |
Case-insensitive. Word-boundaried to avoid false positives.
key = (session_id, pattern_name, last_40_chars_of_match_context)
Within a single daemon run, the same key only fires continue once.
This prevents spam when the error text scrolls up but is still in the
buffer.
If a session is permanently broken (wrong credentials, model deprecated,
loop bug), the daemon will keep firing continue forever as new errors
match new dedupe keys. Watch the daemon log; kill it (Ctrl-C or
kill <pid>) when you see runaway repetition.
Roadmap: per-session retry cap with exponential backoff.
# foreground: Ctrl-C
# background:
pkill -INT -f "ainb fleet daemon"
# or kill by exact PID if you know it
kill <pid>
The daemon's SIGINT handler unregisters from the broker before exit, so
peers won't see a stale ainb-fleet-cp entry.
With --verbose, every detection prints:
[fleet/daemon] broker healthy at 127.0.0.1:7899
[fleet/daemon] auto-continue -> <tmux_session> (<pattern>)
Tail the nohup log to watch in real time:
tail -F ~/.ainb-fleet.log
continue while you're
reading the error, racing your investigation.documentation
Report reflect drain spend over a time window — tokens split by cached (cache_read), uncached writes (cache_creation), and io (input+output), with a $ estimate, grouped by day / outcome / model / transcript. Reads the drainer's cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token failure mode = low cache reuse + high cache writes). Use to answer "what is reflection costing me" for the last day / week.
development
Show fleet status — every claude session running on the host, merged across ainb + claude-peers broker + background jobs. Use when you need to enumerate sessions before composing an action, see which sessions have a peer registered (broker-routable) vs tmux-only, check the `summary` of each session, or pipe the list into jq for filtering. Default output: text table. Pass --format json for LLM consumption.
testing
Ordered multi-step prompts to fleet targets, ack-gated between steps via JSONL assistant-turn-end detection. Use for cycles like disconnect→reconnect→verify, or any flow where step N+1 requires step N to have completed first. The skill BLOCKS until each target's transcript shows the next assistant turn finishing OR per-step timeout fires (default 300s).
development
Center control panel — enumerate every claude session that is blocked waiting on something: a user answer (AskUserQuestion fired), an API error retry, an idle assistant turn-end with no follow-up, or an explicit WAITING: marker. Returns rich JSON with signal kind + context per session. Use this when you've stepped away from the fleet and want one place to see everything that wants your attention and answer it.