[BUG] Task tool: Main thread ends prematurely while subagents run in background (VSCode/Cursor)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When Claude Code spawns multiple subagents using the Task tool (e.g., 4 subagents to analyze different parts of code), it announces "Once all four report back, I'll present my findings and start the discussion." However, immediately after this message, the chat thread ends/closes without waiting for the subagents to complete.
The subagents continue running in the background, but the main thread doesn't wait for their completion. To get updates, I must repeatedly ask "How far are we?" or similar questions. Eventually, after multiple prompts, the main agent checks and discovers the subagents have finished, then continues with presenting the findings.
This appears to be a recent regression (within the last week), as previously the tool calls would remain open and the main thread would wait for subagent completion before ending the turn.
What Should Happen?
When spawning multiple subagents with the Task tool:
- Main thread should remain active/waiting while subagents run in the background
- The tool call should not complete until all subagents have finished their tasks
- Once all subagents complete, the main agent should automatically continue with presenting the aggregated findings
- No user intervention should be needed to check on progress or prompt continuation
Error Messages/Logs
Steps to Reproduce
- Open Claude Code extension in VS Code or Cursor
- Give Claude a prompt that causes it to spawn multiple subagents (e.g., "Analyze this codebase and break it into 4 parallel tasks")
- Observe Claude saying something like: "I'll start 4 subagents. Once all four report back, I'll present my findings and start the discussion."
- Notice the chat thread immediately ends after this message
- The subagents are running in background (can be seen in separate tmux panes)
- Ask "How far are we?" or "Any updates?"
- Claude responds "I'll let you know when they're done" or similar
- Repeat step 6-7 multiple times
- Eventually Claude checks and says "Oh they finished. Let me work with what they provided."
- Only then does the main agent continue with presenting findings
Expected at step 4: The chat should remain open/waiting until all subagents complete, then automatically continue.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Latest (as of Feb 2026) - VSCode extension
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Cursor
Additional Information
Timeline:
This appears to have started within the last week or so (late January/early February 2026). Prior to this, the tool calls remained open while subagents ran, and the main thread would automatically continue once they completed.
Related Observations:
- The subagents DO successfully complete their work (can verify in tmux panes)
- The issue is purely with the main thread's synchronization/waiting mechanism
- Similar to issue #23559 but inverse - here subagents run but main thread doesn't wait
<img width="454" height="1695" alt="Image" src="https://github.com/user-attachments/assets/b086c9eb-30af-46f7-9c2d-6d8332af5793" />
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗