claude-code - 💡(How to fix) Fix [BUG] Agent tool not available to sub-agents — prevents orchestrator pattern [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46424Fetched 2026-04-11 06:20:40
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Sub-agents spawned via the Agent tool do not receive the Agent tool in their own toolset, even when their agent type specifies "All tools". This prevents the orchestrator pattern where a sub-agent spawns and coordinates other agents.

What Should Happen?

Expected: A sub-agent spawned via Agent(name="orchestrator", subagent_type="custom-agent") should have access to the Agent tool so it can spawn its own sub-agents.

Actual: Sub-agents get Bash, Read, Write, Edit, Glob, Grep, SendMessage, TeamCreate, TaskCreate, MCP tools — but NOT Agent. They cannot spawn anything.

Three patterns tested, all fail:

┌──────────────────────────────────────┬────────────────────────────────────────────────────────┬──────────────────────────────────────────┐ │ Spawn Method │ Has Agent tool? │ Result │ ├──────────────────────────────────────┼────────────────────────────────────────────────────────┼──────────────────────────────────────────┤ │ Foreground teammate (team_name set) │ No │ "Teammates cannot spawn other teammates" │ ├──────────────────────────────────────┼────────────────────────────────────────────────────────┼──────────────────────────────────────────┤ │ Foreground inline (no team_name) │ No │ Cannot call Agent() │ ├──────────────────────────────────────┼────────────────────────────────────────────────────────┼──────────────────────────────────────────┤ │ Background (run_in_background: true) │ No Agent, no TeamCreate, no SendMessage, no Task tools │ No orchestration tools at all │ └──────────────────────────────────────┴────────────────────────────────────────────────────────┴──────────────────────────────────────────┘

Environment: Claude Code v2.1.89, macOS, Opus 4.6


Error Messages/Logs

Steps to Reproduce

Repro:

  1. Enable "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" and "teammateMode": "tmux"
  2. Spawn: Agent(name="test", subagent_type="general-purpose", prompt="List all your available tools")
  3. Sub-agent reports no Agent tool

Impact: Blocks "agent of agents" orchestrator pattern. The only entity that can call Agent() is the top-level REPL.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.89

Platform

Other

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

extent analysis

TL;DR

  • The issue can be mitigated by re-examining the configuration and spawn methods for sub-agents to ensure they have the necessary permissions and tools, specifically the Agent tool.

Guidance

  • Review the subagent_type configuration to ensure it is set to a type that includes the Agent tool, such as "custom-agent" with specific tool allocations.
  • Verify that the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS environment variable is correctly set to "1" and that "teammateMode" is set to "tmux" as required for the experimental feature.
  • Test spawning sub-agents using different methods (foreground teammate, foreground inline, background) to identify if any of these methods yield the expected result of including the Agent tool.
  • Consider the implications of the orchestrator pattern and whether there are specific requirements or limitations for sub-agents spawned via the Agent tool that might be contributing to the issue.

Notes

  • The issue seems to be related to the experimental feature of agent teams and the specific configuration of sub-agents, which might have unique requirements or limitations not fully explored in the provided information.
  • Without a clear indication of a regression or a last working version, it's challenging to pinpoint the exact cause or to suggest a version-specific fix.

Recommendation

  • Apply workaround: Given the experimental nature of the feature and the lack of information on previous working versions, the best course of action seems to be to apply workarounds or adjustments to the configuration and spawn methods of sub-agents to achieve the desired orchestrator pattern functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING