claude-code - 💡(How to fix) Fix [BUG] Claude Desktop crashes on switching to Code mode (Windows 11 Home, MSIX) [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#49676Fetched 2026-04-17 08:34:28
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

sessionId=undefined, cwd=undefined, suggesting the session fails to initialize. No error is logged — the Electron renderer silently dies, leaving only a leading to an unhandled exception in the renderer process.

Error Messages/Logs

App dies here — no error logged, only a ~35MB Crashpad dump generated

2026-04-17 11:04:56 [error] Sentry caught: {

Fix Action

Fix / Workaround

  • Fresh install with no prior data still crashes (tested after full uninstall + wiping %APPDATA%\Claude, %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc, and registry entries)
    • The VM successfully starts (HcsCreateComputeSystem hr=0x0, VM started successfully, API reachability: REACHABLE) — the crash is in the Electron renderer, not the VM
    • Last log entries before crash (main.log): [CCD] LocalSessions.setFocusedSession: sessionId=null LocalAgentModeSessions.getSupportedCommands: sessionId=undefined, cwd=undefined
    • A ~35MB Crashpad dump is generated at Crashpad/reports/ on each crash
    • Attempted workarounds (none worked): --disable-gpu, ELECTRON_EXTRA_LAUNCH_ARGS, deleting VM bundles, stopping CoworkVMService, hardware_acceleration_mode: false in Preferences
    • Previously working on ~v1.1062 (around April 10). Crash started after auto-update to v1.2773+

Code Example

● # main.log (last entries before crash)
  2026-04-17 11:58:01 [info] [CCD] LocalSessions.setFocusedSession: sessionId=null
  2026-04-17 11:58:01 [info] LocalAgentModeSessions.getSupportedCommands: sessionId=undefined, cwd=undefined
  2026-04-17 11:58:02 [info] Config file written
  2026-04-17 11:58:02 [info] [CCD] LocalSessions.setFocusedSession: sessionId=null
  # App dies here — no error logged, only a ~35MB Crashpad dump generated

  # main.log (Sentry capture on startup)
  2026-04-17 11:04:56 [error] Sentry caught: {
    eventId: '13a17c242cb74bd1877ddf72e5545839',
    type: 'Unknown',
    value: 'No message',
    stack: undefined
  }

  # cowork-service.log (VM is fine, client dies)
  2026/04/17 11:37:32 [Server] Persistent RPC: connection ended: failed to read length: EOF
  2026/04/17 11:37:32 [Server] Session USER:...\Claude has no active connections, idle timeout starts
  # VM remains Running after client crash:
  2026/04/17 11:37:36 [HCS] Properties result: {...,"State":"Running"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Desktop (v1.3109.0.0, MSIX, Windows 11 Home) crashes every time I switch from Chat mode to Code (Agent) mode. Chat mode works fine. The crash is 100% reproducible, even on a completely fresh install with all data wiped. The last log entry before crash shows getSupportedCommands called with sessionId=undefined, cwd=undefined, suggesting the session fails to initialize. No error is logged — the Electron renderer silently dies, leaving only a ~35MB Crashpad dump. The VM itself starts and runs successfully; it's the client-side app that crashes. This started after auto-update from ~v1.1062 to v1.2773+.

What Should Happen?

Title: Claude Desktop crashes on switching to Code mode (Windows 11 Home, MSIX)

Body:

Bug Description

Claude Desktop crashes immediately when switching from Chat mode to Code (Agent) mode. Chat mode works fine. The crash is 100% reproducible.

Environment

  • OS: Windows 11 Home (Build 26200)
  • App version: 1.3109.0.0 (MSIX)
  • GPU: Intel Iris Xe Graphics (Driver 30.0.101.2079)
  • RAM: 15.7 GB

Steps to Reproduce

  1. Open Claude Desktop
  2. Use Chat mode normally (works fine)
  3. Switch to Code mode
  4. App crashes instantly

What I've Tried

  • Clean uninstall + reinstall (all data wiped)
  • --disable-gpu flag
  • hardware_acceleration_mode: false in Preferences
  • Deleting VM bundles / stopping CoworkVMService
  • Setting ELECTRON_EXTRA_LAUNCH_ARGS=--disable-gpu
  • None of the above fixed the crash

Log Analysis

The last entries in main.log before every crash:

[CCD] LocalSessions.setFocusedSession: sessionId=null LocalAgentModeSessions.getSupportedCommands: sessionId=undefined, cwd=undefined

The VM service (cowork-service.log) shows the VM actually starts and runs successfully:

[HCS] HcsCreateComputeSystem returned: hr=0x0 [VM] VM started successfully [RPC] sdk-daemon is ready [VM] API reachability: REACHABLE

Then the Electron client dies (connection ended: failed to read length: EOF) while the VM remains in Running state. A ~35MB Crashpad dump is generated each time.

Notes

  • This started after updating from ~v1.1062 to v1.2773+. Older versions (used ~1 week ago) did not have this issue.
  • The crash happens even on a completely fresh install with no prior data.
  • sessionId=undefined, cwd=undefined suggests the Code mode session initialization fails to resolve these values before calling getSupportedCommands, leading to an unhandled exception in the renderer process.

Error Messages/Logs

# main.log (last entries before crash)
  2026-04-17 11:58:01 [info] [CCD] LocalSessions.setFocusedSession: sessionId=null
  2026-04-17 11:58:01 [info] LocalAgentModeSessions.getSupportedCommands: sessionId=undefined, cwd=undefined
  2026-04-17 11:58:02 [info] Config file written
  2026-04-17 11:58:02 [info] [CCD] LocalSessions.setFocusedSession: sessionId=null
  # App dies here — no error logged, only a ~35MB Crashpad dump generated

  # main.log (Sentry capture on startup)
  2026-04-17 11:04:56 [error] Sentry caught: {
    eventId: '13a17c242cb74bd1877ddf72e5545839',
    type: 'Unknown',
    value: 'No message',
    stack: undefined
  }

  # cowork-service.log (VM is fine, client dies)
  2026/04/17 11:37:32 [Server] Persistent RPC: connection ended: failed to read length: EOF
  2026/04/17 11:37:32 [Server] Session USER:...\Claude has no active connections, idle timeout starts
  # VM remains Running after client crash:
  2026/04/17 11:37:36 [HCS] Properties result: {...,"State":"Running"}

Steps to Reproduce

  1. Install Claude Desktop v1.3109.0.0 (MSIX) on Windows 11 Home (Build 26200)
  2. Launch the app and log in
  3. Use Chat mode — works normally
  4. Click on Code mode (Agent mode) in the sidebar
  5. App crashes immediately — every time, 100% reproducible

Additional context:

  • Fresh install with no prior data still crashes (tested after full uninstall + wiping %APPDATA%\Claude, %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc, and registry entries)
  • The VM successfully starts (HcsCreateComputeSystem hr=0x0, VM started successfully, API reachability: REACHABLE) — the crash is in the Electron renderer, not the VM
  • Last log entries before crash (main.log): [CCD] LocalSessions.setFocusedSession: sessionId=null LocalAgentModeSessions.getSupportedCommands: sessionId=undefined, cwd=undefined
  • A ~35MB Crashpad dump is generated at Crashpad/reports/ on each crash
  • Attempted workarounds (none worked): --disable-gpu, ELECTRON_EXTRA_LAUNCH_ARGS, deleting VM bundles, stopping CoworkVMService, hardware_acceleration_mode: false in Preferences
  • Previously working on ~v1.1062 (around April 10). Crash started after auto-update to v1.2773+

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

1.3109.0.0

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The most likely fix is to investigate and resolve the issue with sessionId and cwd being undefined when calling getSupportedCommands in Code mode.

Guidance

  1. Verify session initialization: Check the code that initializes the session in Code mode to ensure that sessionId and cwd are properly set before calling getSupportedCommands.
  2. Review recent code changes: Since the issue started after updating from ~v1.1062 to v1.2773+, review the code changes made in this version range to identify potential causes.
  3. Check for null or undefined values: Ensure that sessionId and cwd are not null or undefined when calling getSupportedCommands, as this could be causing the crash.
  4. Test with previous versions: Try testing with previous versions (e.g., ~v1.1062) to confirm that the issue is indeed a regression and to identify the specific version where the issue started.
  5. Analyze Crashpad dumps: Investigate the ~35MB Crashpad dumps generated on each crash to gather more information about the cause of the crash.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue seems to be related to the Electron renderer process and not the VM, as the VM starts and runs successfully. The crash is 100% reproducible, and the last log entries before the crash suggest that the session initialization fails to resolve sessionId and cwd values.

Recommendation

Apply a workaround to ensure that sessionId and cwd are properly set before calling getSupportedCommands, or roll back to a previous version (~v1.1062) where the issue was not present, as the current version (v1.3109.0.0) is causing the crash.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Claude Desktop crashes on switching to Code mode (Windows 11 Home, MSIX) [1 comments, 2 participants]