[BUG] Task tool subagent freezes on Windows (native Bun binary) — no error, no timeout

Resolved 💬 6 comments Opened Feb 25, 2026 by min-hinthar Closed Mar 27, 2026

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?

Summary

Task tool subagent spawning freezes indefinitely on Windows (native Bun binary) with no error, no timeout, and no crash. The debug log shows normal operation (file reads, API streaming) then stops dead mid-stream. System remains fully responsive — only Claude Code is frozen.

Environment

  • Claude Code: v2.1.56 (native binary)
  • Platform: MINGW64_NT-10.0-26300 (Windows 11, Git Bash)
  • Node: v25.2.1
  • RAM: 7.6 GB free (not a memory issue)
  • MCP plugins: Context7 only (Playwright disabled). Also reproduces with ALL plugins disabled.
  • Subagent type: gsd-discuss-scout (custom agent with tools: Read, Bash, Grep, Glob, Write — no MCP tools)

Steps to Reproduce

  1. Start Claude Code on Windows (native binary, not npm)
  2. Use Task tool to spawn any subagent (tested with custom agent types and built-in Explore)
  3. Subagent begins working normally (reads files, makes API calls)
  4. Session freezes — no further output, no error, no timeout
  5. Must force-kill the process

Debug Log Evidence

The frozen session's debug log (c3dfb090) shows a clean timeline:

10:54:58  Session starts
10:55:28  MCP servers connected (n8n takes 30s timeout)
10:55:56  Task tool invoked → gsd-discuss-scout subagent spawned
10:55:59  Scout reads 3 files successfully (Read tool)
10:56:05  Scout starts streaming API response
          *** DEBUG LOG STOPS HERE — NO ERROR ***

The last entry is Stream started - received first chunk. No error, no crash, no timeout message. The process simply stops producing output.

What We Ruled Out

| Theory | Evidence Against |
|--------|-----------------|
| RAM exhaustion | 7.6 GB free, system responsive during freeze |
| MCP server hang | Reproduces with ALL MCP plugins disabled |
| OneDrive I/O locking | Project on local drive (C:\Users\...\GitHub\), not OneDrive |
| Large context serialization | Freeze occurs on scout's 2nd API call with ~24K tokens |
| Symlink EPERM (#18109) | Developer Mode enabled, symlinks work |

Related Issues

  • #18109: Windows PowerShell hang — same symptoms (indefinite hang during subagent work), linked to Bun binary. Multiple users confirm in comments (Feb 2026).
  • #4580: 100% CPU freeze during Task tool JSON serialization (macOS)
  • #16470: Heap exhaustion during heavy Task tool usage
  • #15945: MCP server hang with no timeout (different root cause but similar symptoms)

Additional Observations

  1. EPERM on .claude.json atomic writes: 28 EPERM errors in a single session attempting rename(...tmp... -> .claude.json). Something holds a file lock. Not directly causing the freeze but indicates file contention during subagent operations.
  1. claude.ai proxy MCP servers: 5 servers (Stripe, Google Calendar, Sentry, Gmail, n8n) attempt to connect on every session start even though they're not locally configured. n8n takes 30 seconds to timeout. These are account-linked servers that can't be disabled locally.
  1. Reproducibility: ~16 freezes across 2 days. Affects both custom agent types and built-in Explore agents (plan mode). Does NOT affect the main session's direct tool usage (Read, Bash, Grep all work fine in the same session).

Expected Behavior

Task tool subagent should either:

  1. Complete its work and return results
  2. Time out with an error after a configurable period
  3. Surface any underlying error (stdio pipe issue, process spawn failure) instead of hanging silently

Actual Behavior

Session freezes indefinitely with no error or timeout. Only recourse is force-killing the process.

Version

2.1.56

Platform

Windows (native binary)

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗