claude-code - 💡(How to fix) Fix [BUG] Subprocess crash surfaces as "Interrupted · What should Claude do instead?" with no actionable error [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#54098Fetched 2026-04-28 06:39:18
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

The actual error (only visible in ~/.claude/debug/latest, never shown in UI):

[ERROR] TypeError: TypeError: Cannot read properties of null (reading 'effortLevel') at hH0 (file:///nix/store/.../cli.js:1845:3909) at ew (file:///nix/store/.../cli.js:2207:4166) at process.processTicksAndRejections (node:internal/process/task_queues:103:5)

VSCode extension output log shows the subprocess launching successfully and then:

14:32:20 [info] Received message from webview: {"type":"request",...,"title":"User Exited CLI Session"...}

The extension interprets an unhandled exception exit as "User Exited CLI Session" and displays the interrupt message.

Root Cause

In my specific case the root cause was a CLI/extension version mismatch causing a null deref (filed separately), but the UX problem is independent of the root cause: any subprocess crash will produce this same misleading message.

Code Example

The actual error (only visible in ~/.claude/debug/latest, never shown in UI):


[ERROR] TypeError: TypeError: Cannot read properties of null (reading 'effortLevel')
    at hH0 (file:///nix/store/.../cli.js:1845:3909)
    at ew (file:///nix/store/.../cli.js:2207:4166)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)


VSCode extension output log shows the subprocess launching successfully and then:


14:32:20 [info] Received message from webview: {"type":"request",...,"title":"User Exited CLI Session"...}


The extension interprets an unhandled exception exit as "User Exited CLI Session" and displays the interrupt message.
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?

When the Claude Code CLI subprocess crashes due to an unhandled exception, the VSCode extension displays "Interrupted · What should Claude do instead?" — the same message shown when a user deliberately presses Escape to interrupt a running task.

This is the wrong error surface for a crash. The message implies the user did something to cause the interruption, when in reality the underlying process died. There is no indication that an error occurred, no error message, no suggestion to check logs, and no hint that anything is wrong with the installation. The actual exception is only visible by manually inspecting ~/.claude/debug/latest.

In my specific case the root cause was a CLI/extension version mismatch causing a null deref (filed separately), but the UX problem is independent of the root cause: any subprocess crash will produce this same misleading message.

What Should Happen?

When the CLI subprocess exits unexpectedly (non-zero exit code, unhandled exception, or signal), the extension should distinguish this from a user-initiated interrupt and show an appropriate error state — for example:

  • "Claude Code encountered an error and stopped. Check logs for details." with a link to the debug log, or
  • The actual exception message surfaced in the UI, or
  • At minimum, a different message than the one shown when the user intentionally interrupts

"Interrupted · What should Claude do instead?" should be reserved for user-initiated interrupts only.

Error Messages/Logs

The actual error (only visible in ~/.claude/debug/latest, never shown in UI):


[ERROR] TypeError: TypeError: Cannot read properties of null (reading 'effortLevel')
    at hH0 (file:///nix/store/.../cli.js:1845:3909)
    at ew (file:///nix/store/.../cli.js:2207:4166)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)


VSCode extension output log shows the subprocess launching successfully and then:


14:32:20 [info] Received message from webview: {"type":"request",...,"title":"User Exited CLI Session"...}


The extension interprets an unhandled exception exit as "User Exited CLI Session" and displays the interrupt message.

Steps to Reproduce

Any condition that causes the CLI subprocess to exit unexpectedly will trigger this. One concrete reproduction (also filed as a separate bug):

  1. Install CLI at version 2.0.76, VSCode extension at 2.1.118
  2. Open Claude Code panel in VSCode
  3. Send any message
  4. Observe: "Interrupted · What should Claude do instead?" with no other indication of error
  5. Check ~/.claude/debug/latest to find the actual unhandled exception

The misleading UX is reproducible with any subprocess crash regardless of root cause.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.76 (CLI) / 2.1.118 (VSCode extension)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

The VSCode extension log shows the internal state label "User Exited CLI Session" being set on subprocess exit regardless of exit reason. This suggests the extension doesn't distinguish between clean user-initiated exits and unexpected crashes when deciding what to show the user. A clean fix would be to check the exit code/reason and branch the displayed message accordingly. The debug log path (~/.claude/debug/latest) is also not surfaced anywhere in the UI — users have no way to know it exists without external knowledge.

Note: the root cause of the crash in my case is filed as a separate bug (CLI/extension version mismatch causing null deref on effortLevel). This report is specifically about the misleading error surface, which would affect any crash scenario.

extent analysis

TL;DR

The VSCode extension should be modified to distinguish between user-initiated interrupts and subprocess crashes, displaying an appropriate error message instead of "Interrupted · What should Claude do instead?".

Guidance

  • Check the exit code and reason of the subprocess to determine if it was a user-initiated interrupt or an unexpected crash.
  • Modify the extension to display a different message for crashes, such as "Claude Code encountered an error and stopped. Check logs for details." with a link to the debug log.
  • Consider surfacing the debug log path (~/.claude/debug/latest) in the UI to help users troubleshoot issues.
  • Review the internal state label "User Exited CLI Session" to ensure it is not being set incorrectly for unexpected crashes.

Example

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

Notes

The root cause of the crash is filed as a separate bug, and this report focuses on the misleading error surface. The suggested fix should be applied regardless of the root cause of the crash.

Recommendation

Apply a workaround to modify the extension to display an appropriate error message for subprocess crashes, as the issue is not specific to a particular version and the root cause is being addressed separately.

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