Allow subagents to declare nested-Agent capability in frontmatter tools:

Resolved 💬 3 comments Opened Apr 18, 2026 by cortexive Closed May 26, 2026

Summary

Claude Code subagents cannot spawn nested agents via the Agent/Task tool, even when the agent definition's tools: frontmatter explicitly lists it. Agent/Task is specifically excluded from subagent deferred-tool registries, while WebSearch, Monitor, and mcp__* materialize normally.

Evidence

From a reproducible session, the subagent transcript contains this call:

ToolSearch("select:Task") → "No matching deferred tools found"

The same ToolSearch call from the parent session resolves successfully. Other deferred tools (WebSearch, Monitor, various MCP tools) materialize in the subagent without issue. This confirms Agent/Task is selectively filtered from subagent tool registries regardless of frontmatter declaration.

Request

Allow Agent (and its Task alias) in agent-definition tools: frontmatter as an opt-in to nested spawning. Default policy (exclusion) unchanged — only explicit declaration unlocks the capability.

Rationale: nested dispatch is required for workflows where a subagent legitimately orchestrates further specialized work (e.g. a code-review agent dispatching per-file reviewers, a quality-convergence skill dispatching perspective-holders). Current exclusion forces the orchestrating logic back into the parent session's context, inflating token usage and coupling subagent boundaries.

Interim workaround

We currently invoke the orchestrating skill inline in the parent session rather than in a fresh subagent. Surface-based enforcement of the skill's semantics is orthogonal to dispatch location, so the workaround is functional — but it loses the context-isolation benefit that motivated the subagent dispatch in the first place.

Reproduction reference

Minimal repro: any agent definition with tools: [Agent] in frontmatter, dispatched via Agent(...), which then attempts ToolSearch("select:Task") or ToolSearch("select:Agent"). Result: "No matching deferred tools found". Compare against the same call from the parent session with identical ToolSearch availability.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗