[BUG] Cowork crashes and relaunches app when returning after extended idle — stale Hyper-V VM survives Windows Fast Startup hibernation (Windows 11)

Resolved 💬 5 comments Opened Apr 4, 2026 by obrienatimothy-sketch Closed May 26, 2026

Bug Description

On Windows 11 Pro, opening the Cowork workspace after an extended absence (roughly 9+ hours) causes Claude Desktop to crash and relaunch itself. The app disappears and reopens; the Cowork workspace eventually comes up after the relaunch completes.

This happens 100% reliably after a long idle gap. During active daily use it doesn't occur.

Related issues

  • #32936 — VM already running / parallel startup race condition (similar root cause: stale VM + shutdown timeout, but triggers on quick relaunch in seconds, not extended absence)
  • #28309 — hvsock dies after idle (different failure mode: socket drops mid-session, not full crash-restart)

---

Root Cause

Cowork runs a local Hyper-V VM (vmwp.exe). When Claude Desktop shuts down, it fires cowork-vm-shutdown as part of onQuitCleanup — and this reports success in main.log:

[info] Running onQuitCleanup: cowork-vm-shutdown
[info] Successfully run onQuitCleanup: cowork-vm-shutdown

However, Windows Fast Startup (enabled by default on most Windows 11 machines) causes "shut down" to hibernate the kernel session rather than fully terminating it. The Hyper-V VM process survives this hibernate/resume cycle as an orphaned process. When Claude Desktop next tries to start the Cowork VM, it detects the stale instance and triggers a forced recovery — killing the old VM and starting fresh — which manifests to the user as a full app crash and relaunch.

The CoworkVMService Windows Event Log (cowork-service-events.txt) shows hundreds of Incorrect function (Win32 ERROR_INVALID_FUNCTION, code 1) events during these lifecycle failures.

cowork-service.log shows the stopVMisGuestConnected polling → eventual forced restart cycle that occurs during recovery:

[Server] Received request: method=stopVM
[VM] Stopping VM...
[VM] Releasing VM resources...
-- app relaunches --
[Server] Received request: method=isGuestConnected  (x12 in rapid succession, ~6 seconds apart)

---

Workaround Required

Because the crash occurs reliably and there is no in-app recovery UI, I had to create a Windows Scheduled Task that runs hourly to kill orphaned Cowork VMs:

C:\Users\obrie\scripts\clear-cowork-vms.ps1:

# Kill orphaned vmwp.exe if Claude isn't running, or if VM is 4+ hours old (stale)
$vmProcess = Get-Process -Name "vmwp" -ErrorAction SilentlyContinue
if (-not $vmProcess) { exit 0 }

$claudeRunning = Get-Process -Name "claude" -ErrorAction SilentlyContinue
$vmAge = (Get-Date) - $vmProcess.StartTime

if (-not $claudeRunning -or $vmAge.TotalHours -gt 4) {
    Stop-Process -Name "vmwp" -Force
    Restart-Service -Name "vmcompute" -Force
}

Registered as task ClearCoworkVMs — runs at logon + every 1 hour. This mitigates but does not eliminate the issue: if you open Cowork in the window between hourly checks, the crash still occurs.

---

Steps to Reproduce

  1. Use Cowork actively, then close Claude Desktop normally (or leave it idle overnight)
  2. Ensure Windows Fast Startup is enabled (default on most Win11 installs)
  3. After 9+ hours, reopen Claude Desktop
  4. Navigate to Cowork tab
  5. App crashes and relaunches; workspace appears after relaunch completes

Disabling Windows Fast Startup (powercfg /h off) reduces frequency but does not eliminate it — the VM can also become stale during long idle sessions without a full shutdown.

---

Expected Behavior

  1. cowork-vm-shutdown should actually terminate the Hyper-V VM process, not just signal it — the current implementation reports success even when vmwp.exe survives
  2. On Cowork startup, if a stale VM is detected, the app should handle recovery without crashing — show a "Restarting workspace..." banner instead of relaunching the entire app
  3. The VM should be defensively killed before attempting a new boot (not just checked)

---

Environment

| Detail | Value |
|--------|-------|
| Claude Desktop | MSIX 1.1.9493 (Windows Store) |
| Claude Code (embedded) | 2.1.90 |
| OS | Windows 11 Pro 10.0.26200 |
| Hyper-V | Enabled |
| Windows Fast Startup | Enabled (default) |
| RAM | 16 GB |

Log Files

  • %APPDATA%\Claude\logs\main.logcowork-vm-shutdown success/failure + app restart sequence
  • %APPDATA%\Claude\logs\cowork-service.logstopVM / isGuestConnected RPC cycle
  • %APPDATA%\Claude\logs\cowork-service-events.txtCoworkVMService Windows Event Log (Incorrect function entries)
  • %APPDATA%\Claude\logs\coworkd.log — VM mount/unmount lifecycle

View original on GitHub ↗

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