Agent subagent results never delivered to parent in background job sessions
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Workaround ✓ Mentioned in thread ↓
Activity 3 comments · opened Jul 6, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Bug
When running Claude Code as a background job (spawned via the daemon), agents spawned with the Agent tool never deliver their completion results back to the parent session. The parent blocks indefinitely on run_in_background: false, or never receives a completion notification for background agents.
Reproduction
- Start Claude Code as a background job (via the daemon or desktop app)
- Enter a worktree (
EnterWorktree) - Spawn any agent — even a trivial one:
````
Agent({ prompt: "Say hello and nothing else.", run_in_background: false })
- The agent spawns, runs, completes (visible in the tmux swarm view), and goes idle
- The parent session never receives the result — it blocks forever
Observed behavior
- The agent process starts and appears in
ps auxand the tmux swarm view - The agent completes its work (verified by viewing its tmux pane)
- An
idle_notificationteammate message is delivered to the parent, but the Agent tool's completion callback never fires run_in_background: falseblocks indefinitelyrun_in_background: true(default) never sends a completion notification
Expected behavior
The Agent tool should return the agent's final text output to the parent session when the agent completes.
Environment
- Claude Code v2.1.202
- macOS (Darwin 25.5.0, arm64)
- Running as a background job via the daemon
- Inside a git worktree (
.claude/worktrees/) - Tested with
logic-reviewer,security-reviewer,test-reviewer,nitpick-reviewer,general-purpose, and default agent types — all exhibit the same behavior - Tested across two separate attempts (8+ agents total including a trivial "say hello" agent) in the same session
Impact
This blocks any multi-agent workflow from a background job session. Skill workflows that spawn reviewer subagents become non-functional — agents complete but results are lost.
Workaround
None found. The only option is to not use subagents from background job sessions.
3 Comments
Confirmed -- background job + worktree + Agent tool is a bad combination right now. The idle_notification delivering but the completion callback never firing points at a message routing problem specific to the daemon/background path.
A few things that might help you unblock while this is open:
.claude/agent-results/{agent-name}.md) as its last action, then have the parent poll those files instead of waiting on the callback. Ugly, but it unblocks the workflow.The "tested with trivial 'say hello' agent" line in your report is the strongest evidence this is a routing/IPC bug rather than something in the agent logic itself. Good bug report.
Tried to reproduce this on 2.1.233 (Linux): dispatched a background job (
claude --bg) in a fresh git repo with your exact steps —EnterWorktree, then a foregroundAgentspawn that replies "hello", then print the reply. Ran it twice.Both runs completed in under a minute: the job switched into its worktree, spawned the subagent, received the completion notification, printed
The subagent's exact reply: hello, and finished. Nothing blocked or hung, so I couldn't reproduce the behavior you described.Around the time this was filed, background-agent completion handling had several known problems that have since been fixed — see the changelog (e.g. background sessions silently stopping mid-turn, background subagents being cancelled during their startup window, tasks stuck on "Running" after finishing).
This looks fixed in a recent release. Closing — if you can still reproduce it on 2.1.233 or later, reply here with the version and the job transcript and we'll reopen.
🤖 Generated with Claude Code
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.