Nested Subagent banner
gruckion gruckion

Nested Subagent

Development community

Description

Enable nested subagents in Claude Code - subagents can spawn their own subagents

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

Nested Subagent

![Nested Subagent banner](assets/banner.jpg)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Claude Code](https://img.shields.io/badge/Claude%20Code-v1.0.33+-blue.svg)](https://docs.anthropic.com/en/docs/claude-code) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/gruckion/nested-subagent/pulls)

Enable **unlimited nested subagents** in Claude Code. Subagents can spawn their own subagents.


Quick Start

Option 1: Install from Marketplace (Recommended)

  1. Run /plugin in Claude Code
  2. Go to Marketplaces tab
  3. Select + Add Marketplace
  4. Enter gruckion/nested-subagent
  5. Go to Discover tab and install the plugin

Option 2: Install Locally

git clone https://github.com/gruckion/nested-subagent.git
cd nested-subagent/mcp-server && npm install
claude /plugin install ./nested-subagent

Option 3: Per-Session (CLI)

claude --plugin-dir /path/to/nested-subagent

What's Included

Component Name Description
MCP Tool Task Spawns isolated Claude processes with full tool access

Example

![Example terminal session showing 3 levels of nesting](assets/example.png)

Usage

Claude automatically uses the nested subagent tool when your task requires multi-level delegation:

Build a math utility that needs its own subagents for verify, plan, and code steps.
Process these issues where each issue handler spawns specialized workers.
Run a workflow that delegates to sub-sub-agents for parallel execution.

Why Use This?

Claude Code's native Task tool **blocks subagents from spawning other subagents**:

// src/tools/AgentTool/prompt.ts - the recursion blocker
.filter(_ => _.name !== AgentTool.name)

This plugin works around that limitation using the official `claude -p` headless mode. Each spawned