claude-code - 💡(How to fix) Fix Windows auto-update leaves Claude Code in file-locked state — requires reboot or manual service restart [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51954Fetched 2026-04-23 07:40:29
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

  • Or: if the updater can't reliably do this, surface a clear error to the user ("The update completed but Claude Code could not relaunch — please run the attached unstick script") instead of leaving them stuck at an "Open with..." dialog with no app to pick.

Root Cause

This suggests the root cause is CoworkVMService holding an exclusive file lock on the CC binary during the MSIX package swap, leaving the new binary in a state Windows can't execute until the lock is released or the machine reboots. Stopping the service before the update, or killing it + restarting after, resolves the lock.

Fix Action

Fix / Workaround

Workaround (no reboot needed)

Running this in an admin PowerShell restores CC to a launchable state in ~5 seconds:

Code Example

Stop-Service CoworkVMService -Force -ErrorAction SilentlyContinue
taskkill /F /IM "claude.exe" 2>$null
taskkill /F /IM "cowork-svc.exe" 2>$null
Start-Sleep 2
Set-Service CoworkVMService -StartupType Automatic
Start-Service CoworkVMService
RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 Pro, build 10.0.26200
  • Claude Code: desktop + CLI, auto-update enabled
  • Shell: Git Bash
  • Terminal usage: daily, multiple sessions per day

Behavior

When Claude Code auto-updates on Windows, the update installs successfully but Claude Code does not relaunch automatically. After the update completes:

  • Clicking the Claude Code desktop icon or Start-menu shortcut triggers the Windows "Open with..." app picker instead of launching the app.
  • Claude Code is not listed in the "Open with" picker — there is no app to select that resolves the launch.
  • Running claude from a terminal also fails.
  • A full Windows reboot is the only thing that restores normal launching. After reboot, the app works fine until the next auto-update.

This has happened on every auto-update in the past ~2 weeks. It's a recurring productivity hit for daily CC users on Windows.

Expected behavior

After an auto-update, Claude Code should relaunch automatically (or at minimum, the next manual click should launch it cleanly — no reboot required).

Reproduction

  1. Be on Windows 11 with Claude Code installed and auto-update enabled.
  2. Use Claude Code until the in-app update prompt appears.
  3. Accept the update and let it install.
  4. Try to launch Claude Code via desktop icon, Start menu, or terminal.

Actual: Windows "Open with" dialog appears. App unusable until reboot.

Workaround (no reboot needed)

Running this in an admin PowerShell restores CC to a launchable state in ~5 seconds:

Stop-Service CoworkVMService -Force -ErrorAction SilentlyContinue
taskkill /F /IM "claude.exe" 2>$null
taskkill /F /IM "cowork-svc.exe" 2>$null
Start-Sleep 2
Set-Service CoworkVMService -StartupType Automatic
Start-Service CoworkVMService

This suggests the root cause is CoworkVMService holding an exclusive file lock on the CC binary during the MSIX package swap, leaving the new binary in a state Windows can't execute until the lock is released or the machine reboots. Stopping the service before the update, or killing it + restarting after, resolves the lock.

Suggested fix paths

  • Have the auto-updater stop CoworkVMService (and any child processes) before the MSIX swap, then restart it after.
  • Or: wait for all CC file handles to release before marking the update complete + attempting relaunch.
  • Or: if the updater can't reliably do this, surface a clear error to the user ("The update completed but Claude Code could not relaunch — please run the attached unstick script") instead of leaving them stuck at an "Open with..." dialog with no app to pick.

Frequency

Happens on every auto-update since ~mid-April 2026. Multiple users on Windows seem to hit this based on GitHub issue search.

Happy to provide logs if there's a specific log path to grab. Thanks.

extent analysis

TL;DR

The most likely fix is to modify the auto-updater to stop the CoworkVMService before the MSIX package swap and restart it after, to prevent the service from holding an exclusive file lock on the CC binary.

Guidance

  • Verify that stopping the CoworkVMService before the update and restarting it after resolves the issue, as suggested by the provided PowerShell workaround.
  • Investigate modifying the auto-updater to stop the CoworkVMService and any child processes before the MSIX swap, and restart it after the update is complete.
  • Consider implementing a check to ensure all CC file handles are released before marking the update complete and attempting to relaunch the application.
  • If the above solutions are not feasible, consider surfacing a clear error message to the user with instructions to run a script to release the file lock, such as the provided PowerShell workaround.

Example

The provided PowerShell script can be used as a starting point for the auto-updater modification:

Stop-Service CoworkVMService -Force -ErrorAction SilentlyContinue
taskkill /F /IM "claude.exe" 2>$null
taskkill /F /IM "cowork-svc.exe" 2>$null
Start-Sleep 2
Set-Service CoworkVMService -StartupType Automatic
Start-Service CoworkVMService

Notes

The issue seems to be specific to Windows 11 and the CoworkVMService holding an exclusive file lock on the CC binary. The provided workaround suggests that stopping and restarting the service resolves the issue.

Recommendation

Apply the workaround by modifying the auto-updater to stop the CoworkVMService before the MSIX package swap and restart it after, as this seems to be the most straightforward solution to prevent the file lock issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After an auto-update, Claude Code should relaunch automatically (or at minimum, the next manual click should launch it cleanly — no reboot required).

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING