swarm-agent-troubleshooting

Diagnose and fix swarm agent spawn failures when agents don't start processing tasks

Best use case

swarm-agent-troubleshooting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Diagnose and fix swarm agent spawn failures when agents don't start processing tasks

Teams using swarm-agent-troubleshooting 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/swarm-agent-troubleshooting/SKILL.md --create-dirs "https://raw.githubusercontent.com/stevengonsalvez/agents-in-a-box/main/toolkit/packages/skills/swarm-agent-troubleshooting/SKILL.md"

Manual Installation

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

How swarm-agent-troubleshooting Compares

Feature / Agentswarm-agent-troubleshootingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Diagnose and fix swarm agent spawn failures when agents don't start processing tasks

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

# Swarm Agent Troubleshooting

Diagnose and fix swarm agent spawn failures when agents don't start processing tasks.

## When to Use

- Agent tmux session created but stuck at shell prompt
- Agent not responding to inbox messages
- `wait_for_claude_ready()` times out
- Symptoms: dotenv prompt, zsh theme loading, or no Claude banner visible

## Quick Diagnosis

```bash
# 1. List swarm sessions
tmux list-sessions | grep swarm

# 2. Attach to stuck agent
tmux attach -t swarm-XXXX-agent-1

# 3. Check what's showing:
#    - Shell prompt (zsh/bash) = Claude didn't start
#    - "dotenv: found '.env'" = Blocked by prompt
#    - Claude banner = Ready (check if task was sent)
```

## Common Causes

| Symptom | Cause | Fix |
|---------|-------|-----|
| `dotenv: found '.env' file. Source it?` | dotenv plugin prompt | Send `a` (always) then restart claude |
| Shell prompt showing | Claude command never ran | Manually run `claude --dangerously-skip-permissions` |
| Claude banner but idle | Task not sent after spawn | Resend the task prompt |
| "command not found: claude" | Claude not in PATH | Check `which claude` or use full path |

## Manual Recovery Steps

```bash
# Step 1: Attach to the stuck session
tmux attach -t swarm-XXXX-agent-1

# Step 2: If at dotenv prompt, answer it
# (type 'a' for always, then Enter)

# Step 3: If at shell, start Claude manually
claude --dangerously-skip-permissions

# Step 4: Once Claude is ready, send the task
# (paste the agent's task prompt)

# Step 5: Detach (Ctrl+B, D) and continue monitoring
```

## Prevention

### Update Shell Config

Add to `~/.zshrc` or `~/.bashrc`:
```bash
# Auto-accept dotenv in non-interactive contexts
export DOTENV_ASSUME_YES=1
```

### Increase Detection Timeout

In `spawn-agent-lib.sh`, increase the timeout:
```bash
wait_for_claude_ready "$SESSION" 60  # Increase from 30 to 60 seconds
```

### Add Detection Patterns

The `wait_for_claude_ready()` function looks for these patterns:
- "Claude Code"
- "Welcome back"
- "──────" (horizontal rule)
- "Style:"
- "bypass permissions"

If your terminal has different output, add patterns to the grep regex.

## Debug Logs

Failed spawn attempts save debug output:
```bash
cat /tmp/spawn-agent-swarm-XXXX-agent-1-failure.log
```

## Related

- `/swarm-status` - Check overall swarm health
- `/swarm-shutdown` - Clean up stuck swarm
- `spawn-agent-lib.sh` - Core spawning library

Related Skills

swarm-status

8
from stevengonsalvez/agents-in-a-box

Display comprehensive status dashboard for a swarm team

swarm-shutdown

8
from stevengonsalvez/agents-in-a-box

Gracefully shutdown a swarm team

swarm-orchestration

8
from stevengonsalvez/agents-in-a-box

A tmux-based persistent multi-agent swarm system with file-based inter-agent messaging

swarm-join

8
from stevengonsalvez/agents-in-a-box

Join an existing swarm team as a worker agent

swarm-inbox

8
from stevengonsalvez/agents-in-a-box

Read and send inter-agent messages within a swarm team

swarm-create

8
from stevengonsalvez/agents-in-a-box

Create a new self-sufficient swarm team from a Beads epic with N worker agents + a watchdog daemon that auto-recovers stuck panes and notify-only finalizes when the epic is done. Cross-provider (Claude/Codex/Copilot).

swarm-attach-watchdog

8
from stevengonsalvez/agents-in-a-box

Retrofit a watchdog daemon onto an existing v1 swarm (no recreation). Upgrades team.json to v2 schema and spawns the watchdog tmux session.

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