**[BUG] Cowork locks up after ~5 min — EventEmitter memory leak (MaxListenersExceededWarning) accumulates per session, Electron renderer freezes**
[BUG] Cowork locks up after ~5 min — EventEmitter memory leak (MaxListenersExceededWarning) accumulates per session, Electron renderer freezes
Labels: bug, platform:windows, area:cowork
Environment
- Claude Desktop: 1.12603.1.0 (MSIX, Claude_pzs8sxrjxfjjc)
- OS: Windows 11 Pro x64
- CoworkVMService: present, StartType=Automatic (race condition — stops before Claude launches)
- VM bundle: 6d1538ba6fecc4e5c5583993c4b30bb1875f0f5a
- SDK version: 2.1.170
What happens
Claude Desktop locks up ("Not Responding") after approximately 5 minutes of Cowork use. The CoworkVMService starts successfully and the VM boots cleanly, but the Electron renderer process freezes due to an accumulating EventEmitter memory leak. Restarting Claude Desktop restores function temporarily before the cycle repeats.
Root cause evidence — claude.ai-web.log
MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
11 $eipc_message$...$_AutoUpdater_$_updaterState_$store$_update listeners added.
Use emitter.setMaxListeners() to increase limit
(repeats every ~5–7 minutes across multiple session restarts)
Secondary issue — CoworkVMService race condition
CoworkVMService is set to StartType=Automatic but consistently stops before Claude Desktop launches. Claude Desktop attempts to connect to \\.\pipe\cowork-vm-service before the service is ready, resulting in repeated ENOENT errors and eventual startup failure. Manual Start-Service CoworkVMService resolves it. sc.exe config CoworkVMService start= delayed-auto returns Access Denied even as local admin — the MSIX service descriptor locks out configuration changes.
cowork_vm_node.log — service not running (pre-fix)
2026-06-11 20:43:45 [info] [VM:start] Configuring Windows VM service...
2026-06-11 20:43:45 [warn] [vm-client] Event resubscribe failed: Error: connect ENOENT \\.\pipe\cowork-vm-service
(repeats 1x/sec for 5 seconds)
2026-06-11 20:43:50 [error] [VM:start] Startup failed: Error: VM service not running. The service failed to start.
2026-06-11 20:43:50 [info] [VM:start] Skipping auto-reinstall (already attempted once)
Steps to reproduce
- Launch Claude Desktop on Windows 11 Pro (MSIX install)
- Open a Cowork session
- Use Cowork normally for ~5 minutes
- Observe claude.exe renderer process CPU climbing (PIDs with 30–45 CPU units)
- Claude Desktop becomes unresponsive ("Not Responding")
- Check claude.ai-web.log — MaxListenersExceededWarning present and repeating
Expected vs actual
- Expected: EventEmitter listeners cleaned up when a Cowork session ends
- Actual: Listeners accumulate indefinitely — 11+ per session restart. Renderer freezes once listener count saturates the event loop.
Workarounds (both required)
Start-Service CoworkVMService— run before launching Claude Desktop- Restart Claude Desktop every few sessions to flush leaked listeners
Showing cached comments. Read the full discussion on GitHub ↗
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Thanks for reporting this — I've seen similar memory/resource issues across multi-agent setups and there are a few things worth checking before it gets lost in triage.
Quick diagnostic matrix (3 things to try right now):
ps aux | grep -i nodeduring a session and after exit. Zombie processes after session close = child-process leak.ps -o pid,rss,vsz,comm -p $(pgrep -f claude)at 0 min, 10 min, 30 min. If RSS grows linearly without plateauing, context retention is the leak.lsof -p <pid>for dangling TCP/FIFO handles after tool calls complete.Hardening playbook I use for production AI-coding setups:
timeout 30m ...or equivalent)Happy to share a checklist if this sounds like what you're hitting. This class of issue usually maps to session lifecycle management gaps more than a code bug, and the fix is operational before it's a patch.
Thanks for the suggestions. A few clarifications based on the logs and further testing:
The leak is in the Electron renderer, not child processes or MCP servers.
The
MaxListenersExceededWarningis inclaude.ai-web.log, not in any subprocess:All 9 MCP servers are connected and healthy per
main.logat time of lockup. The issue appears to beAutoUpdaterevent listeners not being removed when Cowork sessions are torn down — classicon()without a correspondingoff()oronce().Root cause appears to be long-running sessions with large context windows.
I was maintaining a single Cowork session across multiple relaunches of Claude Desktop while working on a coding project. The lockup started occurring towards the end of a long session, suggesting context window size is a contributing factor. Each time Claude Desktop was relaunched and reconnected to the existing session, AutoUpdater listeners were re-registered on top of the existing ones without cleanup. The combination of accumulated context and repeated reconnection events appears to drive the listener count past the threshold and freeze the renderer.
Starting a new conversation rather than relaunching resolves it — a fresh session starts with a clean listener slate. This is completely non-obvious; nothing in the UI indicates that relaunch vs. new conversation makes any difference to the underlying session state, and the natural instinct when an app freezes is to relaunch it.
A notable UI signal: after relaunching Claude Desktop, the previous Cowork session consistently showed a blue dot indicator, suggesting the session was still considered active rather than having been properly torn down. This aligns with the listener accumulation pattern — if the session is never fully closed, reconnecting on relaunch adds listeners on top of an already-live session rather than initializing a clean one. The blue dot may be a reliable user-visible indicator of this condition.
CoworkVMServiceremaining running after Claude Desktop exits is the likely mechanism keeping the session alive.Secondary issue: CoworkVMService race condition
Separate from the memory leak,
CoworkVMServiceis set toStartType=Automaticbut consistently stops before Claude Desktop launches. Claude Desktop attempts to connect to\\.\pipe\cowork-vm-servicebefore the service is ready, causing repeated ENOENT errors. ManualStart-Service CoworkVMServiceresolves it.sc.exe config CoworkVMService start= delayed-autoreturns Access Denied even as local admin — the MSIX service descriptor locks out configuration changes, so there's no supported way to set delayed autostart.Suggested fixes:
CoworkVMServicewhen Claude Desktop exits to ensure clean session teardownCoworkVMService, or set it by default in the MSIX installerUpdate, this issue is easily reproducable on a fresh session simply by telling cowork to ingest some files in a folder and before it asks for permission, click off the app and click any other app. I see the permissions request pop up in Cowork, but I cannot click back on the Cowork app as it freezes. When this happens, these errors pop up in the logs
2026-06-13 16:22:05 [warn] Blocked permission check {
permission: 'background-sync',
2026-06-13 16:22:05 [warn] Blocked permission check {
permission: 'background-sync',
2026-06-13 16:25:40 [warn] Blocked permission check {
permission: 'background-sync',
2026-06-13 16:25:40 [warn] Blocked permission check {
permission: 'background-sync',
2026-06-13 16:27:43 [warn] [HostLoop] cli.js stderr: Permission deny rule "JavaScript" matches no known tool — check for typos.
2026-06-13 16:27:59 [info] Emitted tool permission request c336d0fe-9b0d-4ba6-bfa5-6594c3ec0c78 for mcp__cowork__request_cowork_directory in session
local_60511dfd-6ceb-4020-9710-124923c2852a
I believe the background-sync errors are begning, but the JavaScript permission deny seems like a possible cause of the freeze.
Checked all user-side config locations for a misconfigured deny rule:
C:\Users\<user>\.claude\settings.json — only contains autoUpdatesChannel and theme, no permission rules
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\cowork-enabled-cli-ops.json — only contains ownerAccountId
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalState — empty, no VM config files present
No user-configured deny rules exist anywhere in the Windows-side config. The warning originates from cli.js inside the VM itself, tagged as [HostLoop] cli.js stderr, meaning it is emitted by the VM process during boot — not by anything the user can configure or modify.
#####
If I stay in the Cowork window and click to allow file access, this is what is logged:
2026-06-13 16:43:51 [warn] [HostLoop] cli.js stderr: Permission deny rule "JavaScript" matches no known tool — check for typos.
2026-06-13 16:43:56 [info] Emitted tool permission request 058a39fd-ee3b-4f78-a095-5cc237856e01 for mcp__cowork__request_cowork_directory in session
local_60511dfd-6ceb-4020-9710-124923c2852a
2026-06-13 16:45:20 [warn] Blocked permission check {
permission: 'background-sync',
2026-06-13 16:45:20 [warn] Blocked permission check {
permission: 'background-sync',
2026-06-13 16:45:56 [warn] [HostLoop] cli.js stderr: Permission deny rule "JavaScript" matches no known tool — check for typos.
2026-06-13 16:46:08 [info] Emitted tool permission request 759a16b9-1260-462b-86c0-ba2b886c30f2 for mcp__cowork__request_cowork_directory in session
local_60511dfd-6ceb-4020-9710-124923c2852a
2026-06-13 16:46:09 [info] LocalAgentModeSessions.respondToToolPermission: requestId=759a16b9-1260-462b-86c0-ba2b886c30f2, decision=once, hasUpdatedInput=true
2026-06-13 16:46:09 [info] Received permission response for 759a16b9-1260-462b-86c0-ba2b886c30f2: once (tool: mcp__cowork__request_cowork_directory)
You can see the LocalAgentModeSessions.respondToToolPermission which doesn't happen when the windows freezes when Claude isn't the focused window.
Update — root cause identified and resolved
After extended debugging I can confirm the
MaxListenersExceededWarningis a symptom, not the root cause. The actual cause is Windows Fast Startup leaving an orphaned Hyper-V VM process across shutdown/boot cycles.---
What was happening
Windows Fast Startup (
HiberbootEnabled = 1) hibernates the kernel session on shutdown rather than terminating it. The Hyper-V VM process survives the hibernate/resume cycle as an orphaned instance. On the next Claude Desktop launch, HCS contention from the stale VM manifests as Electron main-process event-loop stalls, which degrade the UI thread enough that:CoworkVMServicedrops mid-sessionmcp__cowork__request_cowork_directory,AskUserQuestion) are emitted but never render — session blocks indefinitelyLog evidence captured during an active freeze:
The stalls precede the VM drop every time. No stalls = no drop.
---
Fix
Disable Fast Startup:
Follow with a full cold shutdown and power-on (not restart — restart also bypasses Fast Startup and won't clear existing hibernated Hyper-V state).
After the cold boot: no event-loop stalls,
CoworkVMServiceremains stable across sessions, permission prompts render and are clickable even when Claude is not the focused window.---
Secondary issues confirmed during investigation
CoworkVMServiceships with noFailureActionsconfigured and cannot have them set viasc.exe failure(Access Denied on MSIX services). A scheduled task watchdog at 5-minute intervals is the only available auto-recovery mechanism until the MSIX manifest is updated.Relates to #36590, #59794, #43534.