toolkit/packages/skills/swarm-join/SKILL.md
Join an existing swarm team as a worker agent
npx skillsauth add stevengonsalvez/agents-in-a-box swarm-joinInstall 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.
Join an existing swarm team as a worker agent.
/swarm-join <team-id> --as <agent-name>
| Argument | Required | Description |
|----------|----------|-------------|
| <team-id> | Yes | The swarm team ID to join (e.g., swarm-1738585396) |
| --as | Yes | Agent name to use (e.g., agent-3) |
When you receive this command:
Parse Arguments
TEAM_ID="$1" # First positional argument
AGENT_NAME="$2" # Value after --as
Validate Team Exists
source {{HOME_TOOL_DIR}}/utils/swarm-lib.sh
if ! swarm_get_team "$TEAM_ID" > /dev/null 2>&1; then
echo "Error: Team $TEAM_ID not found"
echo "Available teams:"
swarm_list_teams
exit 1
fi
Check Capacity
TEAM_JSON=$(swarm_get_team "$TEAM_ID")
MAX_MEMBERS=$(echo "$TEAM_JSON" | jq -r '.config.max_members')
CURRENT_COUNT=$(echo "$TEAM_JSON" | jq -r '.members | length')
if [ "$CURRENT_COUNT" -ge "$MAX_MEMBERS" ]; then
echo "Error: Team at max capacity ($MAX_MEMBERS members)"
exit 1
fi
Check Name Availability
if echo "$TEAM_JSON" | jq -e ".members[] | select(.name == \"$AGENT_NAME\")" > /dev/null; then
echo "Error: Agent name '$AGENT_NAME' already in use"
exit 1
fi
Spawn Agent
AGENT_SESSION=$(swarm_spawn_agent "$TEAM_ID" "$AGENT_NAME")
echo "Joined team as: $AGENT_NAME"
echo "Session: $AGENT_SESSION"
Notify Leader
swarm_send_message "$TEAM_ID" "$AGENT_NAME" "leader" "status" \
'{"event": "joined", "message": "Agent '"$AGENT_NAME"' joined the team"}'
Report
echo ""
echo "========================================"
echo "Joined Swarm: $TEAM_ID"
echo "========================================"
echo "Agent Name: $AGENT_NAME"
echo "Session: $AGENT_SESSION"
echo ""
echo "Your inbox: {{HOME_TOOL_DIR}}/swarm/$TEAM_ID/inbox/$AGENT_NAME.jsonl"
echo ""
echo "Commands:"
echo " Check inbox: /swarm-inbox"
echo " Send to leader: /swarm-inbox --to leader --msg \"message\""
echo " Team status: /swarm-status $TEAM_ID"
echo "========================================"
# Join an existing team as agent-3
/swarm-join swarm-1738585396 --as agent-3
# List available teams first
{{HOME_TOOL_DIR}}/utils/swarm-lib.sh list-teams
After joining, the agent should:
As a team member, you must:
Monitor Your Inbox
# Your inbox location
{{HOME_TOOL_DIR}}/swarm/{team-id}/inbox/{agent-name}.jsonl
Execute Assigned Tasks
taskbd update <task-id> --assignee <agent-name> --status in_progressReport Progress
/swarm-inbox --to leader --msg "..." or library functionHandle Completion
bd close <task-id> --reason "Done"| Error | Resolution |
|-------|------------|
| Team not found | Check team ID with swarm_list_teams |
| At max capacity | Wait for a slot or increase max_members in team.json |
| Name already used | Choose a different agent name |
| Session conflict | An agent with this name may still be running |
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.