Agent tool: spawned sub-agents go idle immediately without executing prompt
Summary
Sub-agents spawned via the Agent tool go idle immediately after spawn without executing the given prompt. The parent agent receives only idle_notification signals — the sub-agent never processes its prompt, never responds to SendMessage follow-ups, and never shuts down cleanly.
Environment
- Claude Code version: latest (observed on v2.1.119+)
- Platform: macOS (darwin)
- Shell: zsh
- Reproducible: consistently, across multiple sessions
Steps to Reproduce
- In a session with a project open, invoke the
Agenttool with aprompttargeting work in a different repo/directory (e.g. a sibling repo). - Observe the spawned agent in the Tasks panel.
- Wait.
Expected Behavior
Sub-agent receives the prompt, uses its tools (Read, Edit, Bash, etc.), completes work, and returns a result to the parent.
Actual Behavior
Sub-agent immediately goes idle. The parent receives repeated idle_notification signals. Sending follow-up messages via SendMessage produces no response. The sub-agent never executes a single tool call — not even the first Read or Bash to start the task.
The agent appears to be silently blocked at a permission gate. It cannot escalate the permission prompt to the parent, so it simply stalls.
Root Cause Hypothesis
Sub-agents spawned via Agent tool do not inherit the parent's permission grants. When the sub-agent attempts its first tool call, it hits a permission gate that:
- Does not bubble up to the parent agent for approval
- Does not time out
- Does not produce any visible error
The result is a permanently stalled sub-agent with no recovery path short of killing the session.
Session Evidence
On 2026-05-22, multiple sub-agents were spawned to work on a sibling repo (sagep-df-api). All agents:
- Appeared in the Tasks panel as active
- Sent only
idle_notificationsignals - Never processed any tool calls
- Did not respond to
SendMessagemessages - Did not terminate after receiving shutdown requests
The work had to be abandoned and done manually in the parent session.
Impact
This makes the Agent tool effectively unusable for cross-repo or multi-agent workflows — which is a primary advertised use case. The silent failure mode (no error, no timeout, just idle) makes it very hard to diagnose.
Related Issues
- #61315 — sub-agent stalls at MCP/tool permission gate (same symptom)
- #56860 — background agents spin indefinitely without timeout
- #54626 — zombie processes without cleanup
Suggested Fix
Sub-agents should either:
- Inherit parent's permission grants at spawn time, or
- Escalate permission prompts to the parent agent, or
- Fail fast with a clear error when a required permission is not available (instead of silently stalling)
A timeout on idle sub-agents (with a visible error) would at minimum make the failure mode recoverable.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗