[BUG] In-process team agents lack the Agent tool (cannot spawn subagents)
Description
Team agents spawned with the default --teammate-mode in-process do not have the Agent tool in their available toolset. This prevents them from spawning subagents (e.g., Explore, Plan, or general-purpose agents).
Using --teammate-mode tmux resolves the issue — teammates get full tool access including Agent. This suggests the restriction is specific to the in-process backend, not an intentional design constraint.
Reproduction
- Create a team and spawn a named team agent (any
subagent_type):
TeamCreate(team_name="test-team")
Agent(
name="worker",
team_name="test-team",
subagent_type="general-purpose",
prompt="Search your deferred tools for 'Agent' using ToolSearch, then report whether it exists."
)
- The spawned agent will report
Agentis not in its deferred tools list. - Repeat with
mode: "bypassPermissions"— same result. - Repeat with a custom agent definition that has no
tools:restriction in front matter — same result. - Switch to
--teammate-mode tmux— the agent now hasAgentin its toolset and can spawn subagents.
Tested Configurations (in-process mode)
| Variant | Agent tool available? |
|---|---|
| Default mode | No |
| mode: "bypassPermissions" | No |
| Custom agent, no tools: in front matter | No |
| Custom agent with model: opus | No |
| Built-in general-purpose subagent_type | No |
Impact
In the main session, the standard efficiency pattern is to delegate broad exploration to cheap Haiku subagents:
- "Explore the codebase for all implementations of X" → Haiku scans 50 files, returns 5 relevant locations
- "Read these 20 files and summarize patterns" → Haiku batch-reads, returns a digest
Inside in-process team agents, this pattern breaks. An Opus team agent that needs to explore the codebase has to do all grepping, globbing, and file reading directly in its own context window — consuming expensive tokens on mechanical work that a Haiku subagent could handle.
This makes in-process mode significantly less cost-efficient than tmux mode for non-trivial team workflows.
Expected Behavior
In-process team agents should have the Agent tool available, matching the behavior of tmux-mode teammates. If there's a technical reason this can't work in-process, it should be documented.
Environment
- Claude Code v2.1.71
- macOS (Darwin 24.5.0)
- Model: Claude Opus 4.6
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗