ainb-fleet:ainb-spawn

ainb-fleet:ainb-spawn is a skill for Claude Code from stevengonsalvez/agents-in-a-box. It costs 107 tokens per session (1,868 once invoked), scanned C, original, MIT.

A guide for starting a coding-agent session safely with ainb run. It explains when to create an isolated Git worktree and when to use an existing worktree.

In plain words
What is it for?
Use it when launching Claude, Codex, Gemini, or Copilot sessions, choosing the correct repository path, worktree option, and branch.
Why use it?
It prevents multiple agents from editing the same working folder and avoids nesting one Git worktree inside another.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; mentions Codex.

Part of the ainb-fleet plugin — 12 skills shipped together

Good fit Use it when launching Claude, Codex, Gemini, or Copilot sessions, choosing the correct repository path, worktree option, and branch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stevengonsalvez/agents-in-a-box/ainb-spawn
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add stevengonsalvez/agents-in-a-box --skill ainb-spawn
Clone the repo
git clone --depth 1 https://github.com/stevengonsalvez/agents-in-a-box

Made for: Claude Code.

Or install ainb-fleet, the plugin that ships this one along with the rest of its 12 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ainb-fleet:ainb-spawn

README.md
[![agentmods](https://agentmods.dev/badge/skills/stevengonsalvez/agents-in-a-box/ainb-spawn/github.svg)](https://agentmods.dev/skills/stevengonsalvez/agents-in-a-box/ainb-spawn)
Your own site
<a href="https://agentmods.dev/skills/stevengonsalvez/agents-in-a-box/ainb-spawn"><img src="https://agentmods.dev/badge/skills/stevengonsalvez/agents-in-a-box/ainb-spawn/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ainb-fleet:ainb-spawn

Your own site · 80×15
<a href="https://agentmods.dev/skills/stevengonsalvez/agents-in-a-box/ainb-spawn"><img src="https://agentmods.dev/badge/skills/stevengonsalvez/agents-in-a-box/ainb-spawn.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,868 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01868
Opus 5 $0.00053 $0.00934
Sonnet 5 $0.00021 $0.00374
Haiku 4.5 $0.00011 $0.00187

Measured 10d ago against content hash 35db74d9c1d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

ainb-fleet:ainb-spawn scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

| `rm -rf <dir>` right after a bare `ainb kill` | Deletes the checkout out from under a still-live agent. | `--force`, then confirm via `ainb list` before deleting |
plugins/ainb-fleet/skills/ainb-spawn/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ainb spawn, start a session correctly

One command, two legal shapes for --repo. Getting that choice wrong is what shares a working tree between two agents or nests a worktree inside a worktree.

Fresh session off a repo root (the common case):

ainb run \
  --repo /absolute/path/to/repo-root \
  --worktree --create-branch fix/issue-101 \
  --tool claude \
  --dangerously-skip-permissions \
  -p "$(cat /tmp/task-101.md)"

Existing task worktree (isolation already done, do not nest another):

ainb run --repo /absolute/path/to/existing/worktree --tool claude -p "$(cat task.md)"

Which shape? One command decides it (.git is a file in a real worktree, a directory in a normal clone):

test -f "$P/.git" && echo "worktree: pass bare" || echo "repo root: add --worktree --create-branch"

Flags, and why

Flag Why
--repo <abs-path> Repo root, or an existing task worktree. Absolute, always.
--create-branch <branch> Implies --worktree and names the branch. Prefer over bare --worktree, which invents ainb/session-<shortid>.
--worktree Isolation. Lands at ~/.agents-in-a-box/worktrees/by-name/<repo>--<branch>--<shortid>.
--tool claude|codex|gemini|copilot Which CLI to launch (default claude).
--model <id> Passed through to the provider unchanged. Optional.
--dangerously-skip-permissions Unattended runs only.
-p "<task>" Initial prompt, sent once the input box is ready.
--name <handle> Optional stable tmux handle. Legal: it changes the session/tmux name only, never workspace_name, and fleet routes on the tmux name. Prefer the minted name unless you want something to type at.
--parent <session-id> Routes the child's completions to your inbox. Needs your own session id, which you must resolve (see below), not an env var.

Parent linkage, resolve your own id

There is no $AINB_SESSION_ID. ainb exports only AINB_PARENT_SESSION into a session, and that holds the parent's id, not the session's own. Resolve yours from the tmux session name:

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 130 lines · 107 tokens per session scan C 35db74d9c1d0

Subscribe to this mod's changes

ainb-fleet:ainb-spawn is a skill published in the GitHub repository stevengonsalvez/agents-in-a-box (23 stars, last pushed today), licensed MIT. It adds 107 tokens to every session and 1,868 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.