ainb-fleet:daemon

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.

Best use case

ainb-fleet:daemon is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using ainb-fleet:daemon should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/daemon/SKILL.md --create-dirs "https://raw.githubusercontent.com/stevengonsalvez/agents-in-a-box/main/plugins/ainb-fleet/skills/daemon/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/daemon/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ainb-fleet:daemon Compares

Feature / Agentainb-fleet:daemonStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# ainb fleet:daemon

Background watcher. Registers as peer `ainb-fleet-cp`. Auto-continues
sessions hitting API errors.

## Run

```bash
ainb fleet daemon                    # quiet
ainb fleet daemon --verbose          # log every detection + send
```

For real background use:

```bash
nohup ainb fleet daemon --verbose > ~/.ainb-fleet.log 2>&1 &
```

## What it does each tick (every 5s)

1. Re-discover all sessions (ainb + peers + jobs, merged + deduped).
2. For each tmux-bearing session: `tmux capture-pane -p -S -80` (last 80 lines).
3. Run the API-error regex set over the buffer.
4. If a match fires AND the (session_id, pattern, snippet-tail) dedupe
   key hasn't been seen yet → send `continue` to that session via the
   standard route (peers-first, tmux fallback).

## Detected error patterns

| 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.

## Dedupe key

```
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.

## ⚠️ Sharp edge — no retry cap in v0.1

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.

## Stop the daemon

```bash
# 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.

## Observe what the daemon is doing

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:

```bash
tail -F ~/.ainb-fleet.log
```

## When NOT to run the daemon

- During hand-debugging — the daemon will send `continue` while you're
  reading the error, racing your investigation.
- On a fleet doing batch work that explicitly throws errors as control
  flow — the daemon will misinterpret intentional errors.
- When the broker is down AND every session is tmux-only — the daemon
  still works via tmux fallback but loses peer-aware routing.

Related Skills

test-ainb

8
from stevengonsalvez/agents-in-a-box

Run tests for the ainb (agents-in-a-box) Rust workspace via a 5-layer strategy — unit, insta snapshot, mock-plugin compositing, real-plugin spawn, vhs recording. Wraps cargo + insta + vhs into one CLI. Use when Stevie says "/test-ainb", "test ainb", "run ainb tests", "snapshot <component>", "regenerate vhs tapes", or any phrasing about validating ainb test layers. The skill autodetects which ainb-tui worktree the cwd sits in and dispatches to scripts/run.sh.

ainb-fleet:standup

8
from stevengonsalvez/agents-in-a-box

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.

ainb-fleet:sequence

8
from stevengonsalvez/agents-in-a-box

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).

ainb-fleet:needs

8
from stevengonsalvez/agents-in-a-box

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.

ainb-fleet:fleet-needs

8
from stevengonsalvez/agents-in-a-box

Workflow-backed Jarvis control panel. Runs the deterministic `hangar` workflow with verb=needs (discover → enrich → prioritize), renders the Jarvis HUD from its render-ready cards, fires AskUserQuestion per blocked session, and routes each answer back via tmux send-keys (broker fallback only). Requires the workflow gate (CLAUDE_CODE_WORKFLOWS=1). If the gate is off, fall back to the prompt-driven `/ainb-fleet:needs` skill.

ainb-fleet:broadcast

8
from stevengonsalvez/agents-in-a-box

Fan 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: peers-first (broker HTTP) when peer registered, tmux send-keys fallback otherwise. Refuses to run without an explicit targeting flag (--all, --filter <regex>, or --cwd <substring>) — no implicit fan-out.

ainb-fleet

8
from stevengonsalvez/agents-in-a-box

Fleet orchestration overview — the `ainb fleet ...` Rust subcommand namespace for driving every claude session on the host. Routes to one of five sub-skills (standup / broadcast / sequence / needs / daemon). Invoke this for an at-a-glance map of what fleet can do; reach for the specific sub-skill for the verb you want.

workflow

8
from stevengonsalvez/agents-in-a-box

Guide through structured delivery workflow with plan, implement, validate phases

webapp-testing

8
from stevengonsalvez/agents-in-a-box

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

validate

8
from stevengonsalvez/agents-in-a-box

Verify implementation against specifications

ui-ux-pro-max

8
from stevengonsalvez/agents-in-a-box

UI/UX design intelligence. 67 styles, 96 palettes, 57 font pairings, 25 charts, 13 stacks (React, Next.js, Vue, Svelte, Astro, Nuxt, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, Jetpack Compose). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.

tui-style-guide

8
from stevengonsalvez/agents-in-a-box

TUI style guide for consistent terminal interface design