claude-code - 💡(How to fix) Fix [BUG] Agent-Teams sub-agents with model: opus cannot call SendMessage / TaskCreate / TaskUpdate etc. despite frontmatter declaration (tmux backend) [3 comments, 4 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#52251Fetched 2026-04-24 06:12:09
View on GitHub
Comments
3
Participants
4
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3

When spawning a sub-agent via the Agent tool with model: opus (claude-opus-4-7 / 1M context) inside an Agent Teams context (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, tmux backend), deferred tools listed in the agent's tools: frontmatter — most critically SendMessage and TaskCreate / TaskUpdate / TaskGet / TaskList — are not callable from the spawned process. The identical agent definition spawned with model: sonnet (claude-sonnet-4-6) has all those tools callable and the team communicates correctly.

Concretely confirmed via direct tool-call attempts:

  • Sonnet sub-agent: SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList all succeed.
  • Opus sub-agent: self-reports the same tools as absent from its function schema, and the SendMessage back to the team lead never arrives (observed across repeated sessions, including a prior incident on 2026-04-21 that first surfaced the problem).

Self-reports from the Opus sub-agent additionally list Grep and Glob as missing from its schema, but we have not independently confirmed those with forced invocations — treat the core claim as the deferred tools (SendMessage / Task*), and treat Grep/Glob as a secondary self-report.

This is distinct from #35240 / #34750 — those describe the case where CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS is disabled. In this report the flag is enabled and Sonnet sub-agents work fine, so the tool-registration layer is functional overall. The regression is model-scoped.

Error Message

  • Silent failure: no structured error surfaces to the orchestrator. Only observable via tmux pane inspection, or by timing out waiting for an expected SendMessage response

Root Cause

When spawning a sub-agent via the Agent tool with model: opus (claude-opus-4-7 / 1M context) inside an Agent Teams context (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, tmux backend), deferred tools listed in the agent's tools: frontmatter — most critically SendMessage and TaskCreate / TaskUpdate / TaskGet / TaskList — are not callable from the spawned process. The identical agent definition spawned with model: sonnet (claude-sonnet-4-6) has all those tools callable and the team communicates correctly.

Concretely confirmed via direct tool-call attempts:

  • Sonnet sub-agent: SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList all succeed.
  • Opus sub-agent: self-reports the same tools as absent from its function schema, and the SendMessage back to the team lead never arrives (observed across repeated sessions, including a prior incident on 2026-04-21 that first surfaced the problem).

Self-reports from the Opus sub-agent additionally list Grep and Glob as missing from its schema, but we have not independently confirmed those with forced invocations — treat the core claim as the deferred tools (SendMessage / Task*), and treat Grep/Glob as a secondary self-report.

This is distinct from #35240 / #34750 — those describe the case where CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS is disabled. In this report the flag is enabled and Sonnet sub-agents work fine, so the tool-registration layer is functional overall. The regression is model-scoped.

Fix Action

Fix / Workaround

Workaround: use model: sonnet for all sub-agents that need to communicate back. This loses opus quality for architecture/review roles but restores team functionality.

Code Example

---
   name: probe-opus
   description: Test agent
   tools: Read, Grep, Glob, SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList
   model: opus
   ---

---

Agent({subagent_type: "probe-opus", team_name: "debug", name: "p-opus",
          prompt: "Try calling SendMessage to team-lead with text 'ping'"})
   Agent({subagent_type: "probe-sonnet", team_name: "debug", name: "p-sonnet",
          prompt: "Try calling SendMessage to team-lead with text 'ping'"})

---

/Users/<user>/.local/share/claude/versions/2.1.117
  --agent-id <id>
  --team-name <team>
  --agent-color <color>
  --parent-session-id <session>
  --agent-type <type>
  --permission-mode auto
  --model opus     # or --model sonnet
RAW_BUFFERClick to expand / collapse

[BUG] Agent-Teams sub-agents with model: opus cannot call SendMessage / TaskCreate / TaskUpdate etc. despite frontmatter declaration (tmux backend)

Summary

When spawning a sub-agent via the Agent tool with model: opus (claude-opus-4-7 / 1M context) inside an Agent Teams context (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, tmux backend), deferred tools listed in the agent's tools: frontmatter — most critically SendMessage and TaskCreate / TaskUpdate / TaskGet / TaskList — are not callable from the spawned process. The identical agent definition spawned with model: sonnet (claude-sonnet-4-6) has all those tools callable and the team communicates correctly.

Concretely confirmed via direct tool-call attempts:

  • Sonnet sub-agent: SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList all succeed.
  • Opus sub-agent: self-reports the same tools as absent from its function schema, and the SendMessage back to the team lead never arrives (observed across repeated sessions, including a prior incident on 2026-04-21 that first surfaced the problem).

Self-reports from the Opus sub-agent additionally list Grep and Glob as missing from its schema, but we have not independently confirmed those with forced invocations — treat the core claim as the deferred tools (SendMessage / Task*), and treat Grep/Glob as a secondary self-report.

This is distinct from #35240 / #34750 — those describe the case where CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS is disabled. In this report the flag is enabled and Sonnet sub-agents work fine, so the tool-registration layer is functional overall. The regression is model-scoped.

Environment

  • Claude Code: 2.1.117
  • Platform: macOS (Darwin 24.6.0)
  • Feature flag: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 (verified via tmux pane env)
  • Teammate backend: tmux
  • Affected model: claude-opus-4-7 (1M context), invoked via model: opus in agent frontmatter
  • Unaffected model: claude-sonnet-4-6, invoked via model: sonnet

Steps to Reproduce

  1. Create .claude/agents/probe-opus.md:

    ---
    name: probe-opus
    description: Test agent
    tools: Read, Grep, Glob, SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList
    model: opus
    ---
  2. Create .claude/agents/probe-sonnet.md with identical frontmatter except model: sonnet.

  3. Start a team: TeamCreate({team_name: "debug"})

  4. Spawn both:

    Agent({subagent_type: "probe-opus", team_name: "debug", name: "p-opus",
           prompt: "Try calling SendMessage to team-lead with text 'ping'"})
    Agent({subagent_type: "probe-sonnet", team_name: "debug", name: "p-sonnet",
           prompt: "Try calling SendMessage to team-lead with text 'ping'"})
  5. Observe:

    • p-sonnetSendMessage delivers; TaskCreate / TaskUpdate / TaskGet / TaskList all succeed via direct invocation (verified end-to-end in this report)
    • p-opus → no message arrives; tmux pane inspection shows the model self-reporting the deferred tools as absent from its function schema, and a TaskCreate attempt produces no task

Expected Behavior

All tools declared in the agent's tools: frontmatter should be callable from the spawned sub-agent process, regardless of the model.

Actual Behavior

  • Confirmed by failed invocation (Opus): SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList cannot be called from the sub-agent. SendMessage to the team lead never arrives; TaskCreate produces no task.
  • Self-reported but not independently verified (Opus): Grep and Glob also reported as absent from the function schema. Read and Bash were confirmed callable, consistent with static tools being registered.
  • Control — Sonnet, same frontmatter: all listed tools callable, deferred tools included. Messages and Task CRUD both functioned end-to-end.

Evidence

Self-report captured verbatim from the opus sub-agent's tmux pane:

ツール付与診断の結果を報告します。本プロセスで実際に利用可能なツールは Read のみ でした。

検証結果

  • Read: OK
  • Grep: FAIL(ツール未付与 — 関数スキーマに存在しない)
  • Glob: FAIL(ツール未付与)
  • SendMessage: FAIL(ツール未付与 — このためこの報告は team-lead に届けられません)
  • TaskCreate: FAIL(ツール未付与)
  • TaskUpdate: FAIL(ツール未付与)
  • TaskGet: FAIL(ツール未付与)
  • TaskList: FAIL(ツール未付与)

Frontmatter(tools: Read, Grep, Glob, SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList)で宣言されているが、このサブエージェントプロセスに実際に付与されていないツール: Grep, Glob, SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList

Paired Sonnet agent (same TeamCreate session) with identical frontmatter returned:

All declared tools are available. Read, Bash, Edit, Write, Grep, Glob, SendMessage, TaskCreate, TaskUpdate, TaskGet, TaskList: all ✅

Both panes launched via the same command template (only --model differs):

/Users/<user>/.local/share/claude/versions/2.1.117
  --agent-id <id>
  --team-name <team>
  --agent-color <color>
  --parent-session-id <session>
  --agent-type <type>
  --permission-mode auto
  --model opus     # or --model sonnet

Impact

  • Opus sub-agents cannot communicate with the team lead → deliverables are lost
  • Multi-turn orchestration breaks for any opus-model role (architect, code-reviewer, etc.)
  • Silent failure: no structured error surfaces to the orchestrator. Only observable via tmux pane inspection, or by timing out waiting for an expected SendMessage response
  • validate-agents.sh-style static checks can't detect this since the frontmatter is well-formed; the drift is runtime-only

Related

  • #35240SendMessage gated behind AGENT_TEAMS flag (different scenario: flag-off; here flag is on and Sonnet works)
  • #34750TeamCreate/TeamDelete/SendMessage unavailable despite flag (closed; predates this regression)
  • #51895 — Background sub-agents silent-skip Write for .md (different: run_in_background: true; here tmux backend)
  • #51818 — Teammate CLI crashes on permission_response (different failure mode)

The following recent reports may indicate a broader cluster of Opus-4.7 sub-agent instability in Agent Teams mode; they describe different symptoms but share the environment:

  • #52139 (2026-04-22) — Ink renderer crashes in tmux teammate panes
  • #52223 (2026-04-23) — sub-agent Bash returns minified cli.js source instead of command output
  • #52216 (2026-04-23) — Opus 4.7 sub-agents miss trivially greppable items
  • #51959 (2026-04-22) — Lead agent requires manual stdin to process teammate notifications

Additional Notes

Repeatedly reproducible across sessions. Same-agent, same-prompt, same-team — only model: opus vs model: sonnet toggles the fault.

Workaround: use model: sonnet for all sub-agents that need to communicate back. This loses opus quality for architecture/review roles but restores team functionality.

extent analysis

TL;DR

The issue can be worked around by using model: sonnet for sub-agents that need to communicate with the team lead, as model: opus currently has a regression preventing tools like SendMessage and TaskCreate from being called.

Guidance

  • Verify that the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS flag is enabled and that the team is created successfully before spawning sub-agents.
  • Check the agent's frontmatter to ensure that the tools (SendMessage, TaskCreate, etc.) are correctly declared.
  • Use the provided steps to reproduce the issue and confirm that the problem is specific to model: opus.
  • Consider using model: sonnet as a temporary workaround for sub-agents that require communication with the team lead.

Example

No code changes are suggested at this point, but the following command template can be used to spawn sub-agents with different models:

/Users/<user>/.local/share/claude/versions/2.1.117
  --agent-id <id>
  --team-name <team>
  --agent-color <color>
  --parent-session-id <session>
  --agent-type <type>
  --permission-mode auto
  --model opus     # or --model sonnet

Notes

The issue seems to be specific to model: opus and does not occur with model: sonnet. The problem is reproducible and has been confirmed through direct tool-call attempts.

Recommendation

Apply the workaround by using model: sonnet for sub-agents that need to communicate with the team lead, as this has been shown to resolve the issue. This workaround loses the benefits of model: opus for certain roles but restores team 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