[BUG] Claude Code process exits with code 1 in VS code repeatedly

Resolved 💬 6 comments Opened Mar 7, 2026 by lgelauff Closed Apr 7, 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?

The VS Code extension crashes with Error: Claude Code process exited with code 1 when sending a message during an active session. SessionEnd fires immediately upon receiving the message — before any processing begins — killing the session. This does not reproduce cleanly: it can happen on the first follow-up after a task completes, or after several successful exchanges.

This appears to be the same underlying issue as #14760, which was recently closed. Reopening as a new report since the behaviour is still present in 2.1.71 on a fresh install.

Steps to Reproduce

  1. Open a new Claude Code session in the VS Code extension
  2. Send a task and wait for it to complete (session state goes idle)
  3. Continue with follow-up messages
  4. At an unpredictable point, sending a message triggers immediate SessionEnd and the process exits with code 1 — the message is never processed

What Should Happen?

Expected Behavior

Follow-up messages should be processed normally within the same session.

Actual Behavior

SessionEnd fires within milliseconds of the message being received, before any processing starts. The session exits with code 1.

Error Messages/Logs

2026-03-07 16:51:15.715 [info] From claude: 2026-03-07T15:51:15.715Z [DEBUG] detectFileEncoding failed for expected reason: ENOENT
2026-03-07T15:51:15.715Z [DEBUG] Broken symlink or missing file encountered for settings.json at path: /Library/Application Support/ClaudeCode/managed-settings.json
2026-03-07 16:51:15.715 [info] From claude: 2026-03-07T15:51:15.715Z [DEBUG] Getting matching hook commands for SessionEnd with query: other
2026-03-07T15:51:15.715Z [DEBUG] Found 0 hook matchers in settings
2026-03-07 16:51:15.715 [info] From claude: 2026-03-07T15:51:15.715Z [DEBUG] Matched 0 unique hooks for query "other" (0 before deduplication)
2026-03-07 16:51:16.133 [info] Closing Claude on channel: [channel-id]
2026-03-07 16:51:16.133 [error] Error from Claude (on channel [channel-id]): Error: Claude Code process exited with code 1
2026-03-07 16:52:39.660 [info] Received message from webview: {"type":"request","requestId":"[request-id]","request":{"type":"open_output_panel"}}

Steps to Reproduce

  1. Open a new Claude Code session in the VS Code extension
  2. Send a task and wait for it to complete (session state goes idle)
  3. Continue with follow-up messages
  4. At an unpredictable point, sending a message triggers immediate SessionEnd and the process exits with code 1 — the message is never processed

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.71

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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