Skip to content

[BUG] In-process team agents lack the Agent tool (cannot spawn subagents) #31977

Description

@marcoabreu

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

  1. 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."
)
  1. The spawned agent will report Agent is not in its deferred tools list.
  2. Repeat with mode: "bypassPermissions" — same result.
  3. Repeat with a custom agent definition that has no tools: restriction in front matter — same result.
  4. Switch to --teammate-mode tmux — the agent now has Agent in 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions