claude agents deadlocks when launched with UNC / SMB-mapped working directory (Windows 11)
Summary
claude agents (Claude Code v2.1.139, Windows 11) deadlocks indefinitely when launched with a working directory on a SMB-mapped drive / UNC path. The foreground process becomes silent — no output, no Ctrl+C handling. Closing the terminal window leaves the process running as a child of the Claude daemon. Other Claude Code sessions in the same shell environment continue working; only the agents subcommand wedges.
Environment
- Claude Code:
2.1.139(CLI atC:\Users\<user>\.local\bin\claude.exe) - OS: Windows 11 Pro 10.0.26200
- Shell: PowerShell 7, Windows Terminal
- CWD when launched:
V:\dansvault→ mapped to\mercer\vault\dansvault(SMB share on local LAN, kernel SMB session healthy throughout the hang)
Proof it's NOT a server-side SMB issue
- Ping to SMB host: 0 ms during hang.
Get-SmbConnectionshows TCP 445Established(PID 4 / System) at moment of hang.Get-ChildItem V:\dansvaultfrom a separate PowerShell returns instantly during the hang.- Zero
SMB/Mup/Rdr/LanmanWorkstationevents in the System log around hang time. - Zero
Application Hang/Application Error/ WER events fornode.exeorclaude.exe.
Proof of a real deadlock (5-second perf sample)
| Sample | CPU (s, cumulative) | Threads | WS (MB) | Handles |
|-------:|--------------------:|--------:|--------:|--------:|
| 1 | 8.50 | 51 | 631.5 | 258 |
| 2 | 8.50 | 51 | 631.5 | 258 |
| 3 | 8.50 | 51 | 631.4 | 258 |
| 4 | 8.50 | 51 | 631.2 | 258 |
| 5 | 8.50 | 51 | 631.2 | 258 |
Zero CPU progress, 51 threads parked, working set stable. Rules out V8 GC death-spiral, runaway loop, and OOM.
Likely root cause — directory handle on the UNC root
handle.exe against the frozen PID reports:
58: File \Device\Mup\mercer\vault\dansvault\
That's a directory handle on the Multiple UNC Provider for the cwd. Combined with the 51-threads-at-zero-CPU pattern, this is consistent with a ReadDirectoryChangesW (or equivalent libuv uv_fs_event / chokidar / fs.watch) subscription that the agents subsystem opens to monitor agent/skill files in the project root.
ReadDirectoryChangesW over UNC has documented edge cases — notifications can be lost or never delivered when the SMB session renegotiates, when offline caching is enabled, or when oplock breaks intersect with watcher buffer fills. The hypothesis is that an I/O completion never returns and a sync code path is waiting on it. Without symbols I can't confirm which thread / which path, but the handle list plus zero-progress signature points firmly there.
Reproduction (suggested)
- On Windows 11, map an SMB share as a drive letter (
net use V: \<host>\<share>). cd V:\<some dir>.claude agents. Leave it running.- Hang reproduces within minutes in our environment.
We have observed it on this box across several days, in different terminal windows, with both freshly-launched and long-running invocations. Always claude agents specifically, never the regular session worker.
Daemon behaviour
Claude daemon (claude.exe daemon run) does not detect the wedge. The frozen worker stays in the roster indefinitely. daemon.log shows two unrelated worker kills earlier in the day (bg settled <id> (killed)) but never reaps the hung agents process.
Artifacts captured (available on request)
agents-62300.dmp— 855 MB full memory dump (procdump -ma) — contains all 51 thread stacks + heap.02-handles.txt— Sysinternals handle list output.- Process metadata + 5-sample perf trace.
Path on reporter's machine: C:\Users\<user>\Desktop\claude-agents-hang-20260512-150624\. Happy to upload the dump out-of-band if Anthropic wants it.
Workaround
Launch Claude Code from a local-disk working directory (e.g. mirror V:\dansvault to C:\dansvault). The hang has not reproduced when cwd is on local NTFS.
Why this matters
The new agents subcommand is otherwise great, but on Windows + UNC workflows (which is common for users keeping work on NAS/server shares) it's a hard wedge that requires force-closing the terminal and leaves orphaned worker processes behind. The daemon's own health-check doesn't notice, so RAM accumulates.
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate of any of the three flagged — those are about a different layer of "agents":
Task()tool / model-sidetool_result missing). The token counter stops while the model is still running; user suspects MCP load + skills. My report is aboutclaude agents(the CLI subcommand that manages named agents), wedging outside any conversation — no model call in flight, no Task() tool involved.Task()in-session subagent comms (closed, refs the MCP-duplication issue #28126). Same layer as #37521, not this report.The shared word "agents" is doing a lot of work in the bot's match. To be explicit about what this report is:
claude agents(the CLI command — the agents management UI, not the Task() tool or subagent invocation inside a session).handle.exeagainst the wedged PID shows the only interesting handle isFile \Device\Mup\mercer\vault\dansvault\— a directory handle on the Multiple UNC Provider for the cwd. Consistent with aReadDirectoryChangesW/ libuvuv_fs_event/ chokidar watcher that never gets its I/O completion on a UNC mount.claude agentssubcommand from a UNC cwd with no conversation active. Mine reproduces deterministically that way and leaves the Desktop app + regularclaudesessions untouched.Happy to attach the 855 MB full memory dump (
procdump -ma) or run additional targeted captures if a maintainer wants more before triage.Thanks! This should be fixed in 2.1.142.
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.