[BUG] Windows: main process survives beforeQuitForUpdate; relaunch blocked by single-instance lock (update deadlock, reproduced on two versions)

Status Open
Maintainer reply None cached
Activity 4 comments · opened Sep 25, 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?

On Windows, the Claude Desktop app's stealth auto-update deadlocks. After an idle timeout, the app tears down its window and any running Claude Code sessions and logs beforeQuitForUpdate handler fired, going down for update, but the main process never exits. All child processes (11 claude.exe in tasklist /apps) stay alive under the old package version.

Because the old package is still in use, the staged update can't be applied. Every relaunch attempt exits immediately with Not main instance, returning early from app ready, so the app is dead until the user finds and kills the orphaned processes or reboots. Since the update never lands, the cycle repeats every few hours.

This is reproducible: it happened on 2.2553.13 (2.7032.0 staged), and again after a clean install of 2.7032.0 (2.9939.2 staged). Long-running Claude Code sessions were killed each time, three times in one day.

Environment: Windows 10 Pro 22H2 (10.0.19045) x64, Claude Desktop MSIX Claude_pzs8sxrjxfjjc.

What Should Happen?

  • The process should actually exit after beforeQuitForUpdate. If it doesn't, the updater should detect that and abort or retry, not leave the app dead with no window.
  • A relaunch that finds a hung previous instance should recover (terminate it or hand off), not silently exit on the single-instance lock.
  • Updates should never be applied unattended over running Claude Code sessions. Prompt the user, or stage the update and apply it on the next clean start. There is currently no supported way for unmanaged installs to defer or disable this.

Error Messages/Logs

**main.log (2.7032.0, with 2.9939.2 staged):**

2026-09-24 21:43:54 [info] [stealth-update] Triggering stealth update after idle timeout
2026-09-24 21:43:55 [info] beforeQuitForUpdate handler fired, going down for update
2026-09-24 21:53:54 [info] [stealth-update] Triggering stealth update after idle timeout
2026-09-24 22:13:29 [info] Starting app {
2026-09-24 22:13:29 [info] Not main instance, returning early from app ready
2026-09-24 22:13:36 [info] Starting app {
2026-09-24 22:13:36 [info] Not main instance, returning early from app ready
2026-09-24 22:13:39 [info] Starting app {
2026-09-24 22:13:39 [info] Not main instance, returning early from app ready

Afterward, `tasklist /apps` shows 11 `claude.exe` processes still attributed to `Claude_2.7032.0.0_x64__pzs8sxrjxfjjc`.

**Earlier occurrence (2.2553.13, with 2.7032.0 staged):** after `beforeQuitForUpdate` at 15:59:46, `[process-memory]` lines kept logging from the same PIDs (electron_main, renderer, gpu, utility) for 8+ minutes:

2026-09-23 15:59:46 [info] beforeQuitForUpdate handler fired, going down for update
2026-09-23 16:00:25 [info] [process-memory] ... electron_main:37824:204MB ...
2026-09-23 16:04:09 [info] [updater] Staged version 2.7032.0 is still current
2026-09-23 16:05:24 [info] Starting app { appVersion: '2.2553.13', ... }
2026-09-23 16:05:24 [info] Not main instance, returning early from app ready
2026-09-23 16:07:43 [info] [process-memory] ... electron_main:37824:203MB ...


**Recovery with the standalone installer failed (ClaudeSetup.log):**

WARNING: failed to remove conflicting service: could not open CoworkVMService: Access is denied.
MSIX installation failed: AddPackage failed: AddPackage failed with HRESULT 0x80073CF9

AppXDeploymentServer/Operational event 404:

error 0x800700E9: Unable to install because the following apps need to be closed Claude_pzs8sxrjxfjjc!Claude.

This persisted even when `tasklist /apps` showed no package processes. A reboot was required.

**CoworkVMService DACL** (`sc.exe sdshow CoworkVMService`):

D:(A;;CCLCSWRPWPDTLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;S-1-5-80-1949724575-2387902436-65106593-1201171665-3967308604)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)

There's no ACE for SYSTEM or Administrators, so the app's own elevated installer can't remove it. I had to use `psexec -s sc.exe sdset` to restore access before deleting it.

Steps to Reproduce

  1. Install Claude Desktop (MSIX) on Windows 10 Pro 22H2.
  2. Start a long-running Claude Code session in the desktop app.
  3. Leave the machine idle while a newer version is staged by the updater ([updater] Staged version X is still current in main.log).
  4. After the idle timeout, [stealth-update] Triggering stealth update after idle timeout fires, followed by beforeQuitForUpdate handler fired, going down for update.
  5. The window disappears and the Code session is stopped, but the main process and its children remain running (tasklist /apps | findstr /i claude).
  6. The staged update is never applied (Get-AppxPackage Claude still reports the old version), and every relaunch logs Not main instance, returning early from app ready and exits.
  7. Recovery requires killing all package processes by PID or rebooting.

Reproduced on two consecutive versions (2.2553.13 → 2.7032.0 and 2.7032.0 → 2.9939.2), including after a clean reinstall.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.9939.2

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Impact: The app is unusable for unattended or long-running work. Each deadlock kills any in-progress Claude Code session, and the user has no indication beyond a vanished window. Recovery requires knowing to use tasklist /apps, since the orphaned processes aren't obviously tied to the app, or rebooting.

No supported opt-out: The only way to disable auto-update I could find is the disableAutoUpdates policy value under HKLM\SOFTWARE\Policies\Claude, which is documented for enterprise/MDM deployments. It isn't clear whether unmanaged installs honor it.

Workaround:

tasklist /apps | findstr /i claude
Stop-Process -Id <each PID> -Force

Then relaunch. If the staged update still fails to apply, a reboot followed by the standalone installer.

Related issues: #92246 (Windows forced restarts over running sessions, no opt-out), #95364 and #92207 (stealth update relaunch on idle). This report is specifically about the quit-for-update path hanging, which turns a disruptive restart into a dead app.

View original on GitHub ↗

3 Comments

kanrasan333-sys · 13 days ago

Same deadlock on a newer build: Desktop 2.16120.0 (MSIX) → staged 2.19675.0, Windows 10 Pro 22H2 (19045) x64, Claude Code 2.1.284.

The AppX deployment log shows why the update fails: the app requests registration while its own main process is still alive, Windows refuses, and the process never exits afterwards.

main.log

2026-10-02 00:01:25 [updater] Update downloaded and ready to install { releaseName: 'Claude 2.19675.0' }
2026-10-02 01:42:33 [stealth-update] Triggering stealth update after idle timeout
2026-10-02 01:42:35 [CCD] CLI exit before update: 18 of 18 exited within 1844ms
2026-10-02 01:42:36 beforeQuitForUpdate handler fired, going down for update
2026-10-02 01:43:26 [process-memory] electron(10)=2746MB children(1)=35MB   <- same main/renderer PIDs as before, still alive
2026-10-02 02:32:52 Not main instance, returning early from app ready
2026-10-02 02:34:06 Not main instance, returning early from app ready

Microsoft-Windows-AppXDeploymentServer/Operational (same second, translated from RU locale)

01:42:36  603  RegisterByPackageFamilyName started: Claude_pzs8sxrjxfjjc, options: ForceApplicationShutdownOption
01:42:36  855  updateList: Claude_2.16120.0.0 is updating to Claude_2.19675.0.0
01:42:36  638  Packages were not updated because affected apps are still running: {Claude_pzs8sxrjxfjjc!Claude}
01:42:36  419  Error 0x800700E9: install failed, the following apps must be closed: Claude_pzs8sxrjxfjjc!Claude
01:42:36  404  AppX deployment failed for Claude_2.19675.0.0: 0x80073CF9

So ForceApplicationShutdownOption doesn't help here, and the updater doesn't handle the failed deployment: it neither exits nor retries. The app stays on the old version, and every relaunch hits the single-instance lock. Same pattern in my logs on 2026-09-25 (several cycles) and 2026-09-28/29.

Manual recovery attempts (from a separate PowerShell, outside the app):

  1. Stop-Process -Force on all claude.exe, wait 3 s, then Add-AppxPackage -RegisterByFamilyName -MainPackage Claude_pzs8sxrjxfjjc → 0x80073D02 (Claude_2.16120.0.0 in use).
  2. Kill loop until tasklist /apps showed 0 processes with the package identity, wait 5 more seconds, then the same command with -ForceApplicationShutdown → 0x80073CF9 / 0x800700E9 ... Claude_pzs8sxrjxfjjc!Claude. The AppX log shows CoworkVMService terminated successfully (9648/9650), immediately followed by "affected apps are still running" (638).
  3. Reboot → AppReadiness registered 2.19675.0 after logon (install::Claude_pzs8sxrjxfjjc, 0.53 s). This was the only thing that worked.

So once the deadlock happens, killing processes isn't enough: Windows keeps treating the package as in use until a reboot.

YSRKEN · 11 days ago

Same here on 2.16120.0 → 2.19675.0 (MSIX, Windows 10 22H2 19045 x64). Two details that may help narrow it down:

  • After killing every process outside the app, an elevated enumeration found no process with the Claude_pzs8sxrjxfjjc package identity and no process with any file from the package folder loaded. Add-AppxPackage -RegisterByFamilyName ... -ForceApplicationShutdown still failed with 0x800700E9 / 638 "affected apps are still running" in the same second. So nothing visible is holding the package; the "running" state seems to be stale in the logon session.
  • Each failed attempt leaves CoworkVMService set to Disabled (System log 7040 "auto start → disabled" right after the 603). After a reboot, the deferred registration ran at logon, 2.19675.0 installed, and the service went back to Automatic.
abccbaandy · 8 days ago

Still reproduces on the next build: Desktop 2.19675.0 (MSIX) → staged 2.19675.1, Windows 10 Pro 22H2 (19045) x64, Claude Code 2.1.286. Triggered via the manual "restart to update" button (not only the idle stealth path).

main.log

2026-10-07 00:33:02 [updater] Update downloaded and ready to install { releaseName: 'Claude 2.19675.1' }
2026-10-07 00:36:04 [CCD] CLI exit before update: 4 of 4 exited within 759ms
2026-10-07 00:36:04 beforeQuitForUpdate handler fired, going down for update
2026-10-07 00:36:25 [process-memory] ... electron_main:28056:229MB ...   <- same main PID still alive
2026-10-07 00:37:24 [process-memory] ... electron_main:28056:230MB ...
2026-10-07 00:38:18 Starting app { appVersion: '2.19675.0' }
2026-10-07 00:38:18 Not main instance, returning early from app ready

AppXDeploymentServer/Operational

00:33:02  603  Add Claude-<hash>.msix, options: DeferRegistrationWhenPackagesAreInUse
00:33:02  658  Claude_2.19675.1.0 marked for deferred registration because Claude_2.19675.0.0 is in use
00:36:04  603  RegisterByPackageFamilyName Claude_pzs8sxrjxfjjc, ForceApplicationShutdownOption
00:36:04  638  Package not updated because affected apps are still running: {Claude_pzs8sxrjxfjjc!Claude}
00:36:04  419  0x800700E9: the following apps must be closed: Claude_pzs8sxrjxfjjc!Claude
00:36:05  404  AppX deployment failed with 0x80073CF9

Same sequence on an earlier attempt the same evening (22:03 Add → 22:14 Register → 0x80073CF9), so it's deterministic here. Killing all processes via Task Manager and relaunching still starts 2.19675.0.

Showing cached comments. Read the full discussion on GitHub ↗