/ainb-fleet:costfrom ainb-fleet
Shows fleet spend: per-session, per-model, per-day, and per-group USD cost rollups for Claude/Codex sessions, with budget breach alerts. Invoke via /ainb-fleet:cost or mention fleet cost/spend.
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.
Fleet-shaped spend rollups. ainb already tracks cost_usd per provider call
(the burndown plugin aggregates it); this verb reshapes that data into
per-session / per-model / per-day / per-group USD totals joined to the live
fleet, and evaluates configured budget caps.
ainb fleet cost # text tables (default)
ainb --format json fleet cost # JSON for piping
ainb --format json fleet cost --period week # window: today|week|30days|month|all
--format is a global flag — it goes before fleet, not after cost.
The --period window scopes the data (default month): burndown date-bounds
its call set and re-aggregates, so a narrower period returns less spend; all
reports lifetime totals.
| field | meaning |
|---|---|
totals | fleet-wide {cost_usd, bucket, session_count, model_count} |
sessions[] | per-session {session_id, provider, project, cwd?, group?, cost_usd, bucket}, sorted by descending cost |
models[] | per-model {model, cost_usd, bucket}, sorted by descending cost |
daily[] | per-day {date, cost_usd, bucket} |
groups[] | per-workspace {group, cost_usd, session_count, bucket} (only sessions that match a live fleet cwd) |
budget_breaches[] | {scope, subject, cwd?, cost_usd, limit_usd} — caps crossed this run (also delivered to notifyd) |
bucket is the token breakdown: input_tokens, cache_creation_tokens,
cache_read_tokens, output_tokens, reasoning_tokens, call_count,
cost_usd.
Configure spend ceilings in config.toml (project config overrides user
config). A breach fires a notifyd alert (Notification:budget_exceeded,
surfacing as WaitingOnUser) and lands in notifications.db.
[fleet.cost]
session_usd = 5.0 # warn when any single session crosses $5
group_usd = 25.0 # warn when any workspace group crosses $25
[fleet.cost.session_overrides]
"abc123" = 50.0 # a long-running session gets its own ceiling
[fleet.cost.group_overrides]
"infra" = 100.0 # the infra workspace gets a higher ceiling
Override maps take precedence over the blanket session_usd / group_usd.
With no caps configured, budget_breaches is always empty.
# Most expensive session
ainb --format json fleet cost | jq '.sessions[0]'
# Total spend this month
ainb --format json fleet cost | jq '.totals.cost_usd'
# Any budget breaches right now?
ainb --format json fleet cost | jq '.budget_breaches'
# Spend by group, biggest first
ainb --format json fleet cost | jq '.groups[] | {group, cost_usd}'
~/.claude/projects;
raise the budget with AINB_USAGE_TIMEOUT_SECS=<n> for very large
archives. Subsequent calls hit the cache and return in well under a second.group on a session is only populated when its resolved cwd matches
a session in the live fleet (via workspace_name). Sessions that have
ended drop out of the group rollup but still appear in sessions[].ainb usage plan ....What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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.
/daemonainb-fleet:daemonLong-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.
Other plugins' skills for the same job