Swarm Agent For Claude Code banner
shaadahmade shaadahmade

Swarm Agent For Claude Code

Git community

Description

Claude Code skill that decomposes a large goal into a recursive tree of agents, where each agent can spawn its own agents and results merge back up to a single answer.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Agent Swarm

A Claude Code skill that breaks one large goal into a tree of agents. A master agent splits the work, spawns child agents to handle each part, and those children can split their own work and spawn children of their own. Results are written to disk and merged back up the tree until the master returns a single combined answer.

Why not built-in subagents

Task-tool subagents cannot spawn subagents of their own, so recursion is impossible with them. This skill launches every node as a separate headless Claude Code process (`claude -p`), so any level of the tree can go deeper. The filesystem is the only channel between agents, which makes every run inspectable, crash tolerant, and resumable.

How it works

  1. You give the skill a goal. The current session becomes the root node.
  2. Each node decides one of two things: EXECUTE the task directly, or DECOMPOSE it into two or more separable subtasks.
  3. To decompose, a node writes a task.md for each child and runs spawn.sh, which launches a real Claude process for that child.
  4. A child sees only its own task.md plus the node protocol. It has no conversation history and no knowledge of its siblings.
  5. Every node finishes by writing result.md and status.json. A parent reads only those two files from each child, merges them, and writes its own.
  6. The merge continues upward until the root produces the final answer.

Installation

Clone into your skills directory. Per project:

git clone https://github.com/shaadahmade/Swarm-agent-for-claude-code .claude/skills/agent-swarm

Or for all projects:

git clone https://github.com/shaadahmade/Swarm-agent-for-claude-code ~/.claude/skills/agent-swarm

Skills are loaded at startup, so restart Claude Code before the skill appears.

Requirements

  • claude CLI on PATH
  • bash
  • python3

On Windows, run the scripts from Git Bash. The scripts use POSIX paths and are invoked through the Bash tool, not PowerShell.