Stop running swarm agents gracefully
Gracefully stops one or all running swarm agents, archives the session, and generates a final sync report. Use this when you need to terminate a multi-agent session cleanly while preserving all findings and results.
/plugin marketplace add arevlo/claude-code-workflows/plugin install arevlo-swarm@claude-code-workflowsStop one or all running swarm agents.
/stop [agent] [--all] [--force]
Arguments:
agent - Stop specific agent--all - Stop all agents (default if no agent specified)--force - Force kill without graceful shutdownCheck for active swarm:
.claude/swarm/manifest.jsonIf specific agent:
bash/zsh (macOS, Linux, Git Bash, WSL):
pid=$(cat .claude/swarm/pids/<agent>.pid)
kill $pid
rm .claude/swarm/pids/<agent>.pid
PowerShell (Windows):
$pid = Get-Content .claude/swarm/pids/<agent>.pid
Stop-Process -Id $pid -Force
Remove-Item .claude/swarm/pids/<agent>.pid
If --all or no args:
bash/zsh (macOS, Linux, Git Bash, WSL):
for pid_file in .claude/swarm/pids/*.pid; do
pid=$(cat "$pid_file")
kill $pid 2>/dev/null
rm "$pid_file"
done
PowerShell (Windows):
Get-ChildItem .claude/swarm/pids/*.pid | ForEach-Object {
$pid = Get-Content $_.FullName
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
Remove-Item $_.FullName
}
Archive session:
.claude/swarm/archive/<timestamp>/Clean up:
rm .claude/swarm/manifest.json
rm .claude/swarm/started_at
Final sync:
/sync to consolidate any remaining findingsSTOPPING SWARM
═══════════════════════════════════════════════════
Stopping agents...
[OK] reviewer (PID 12345) - stopped
[OK] type-analyzer (PID 12346) - stopped
[OK] silent-hunter (PID 12347) - stopped
SESSION SUMMARY
───────────────────────────────────────────────────
Duration: 1h 23m
Reports generated: 45
Issues found: 14 (2 critical, 4 high, 8 other)
Archives saved to: .claude/swarm/archive/2024-01-15-103000/
Final sync report: .claude/swarm/sync/final-1705312200.md
/swarm to start a new session