VSCode Extension - SessionEnd fires immediately after message, causing "process exited with code 1"

Resolved 💬 5 comments Opened Dec 19, 2025 by donrosenthal Closed Feb 26, 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 VSCode extension crashes with "Error: Claude Code process exited with code 1" when sending a message after an idle period. The logs show that SessionEnd fires immediately (within 14ms) after the message is received, before Claude begins processing. This terminates the session unexpectedly.

The issue has been increasing in frequency over ~2 weeks of active development work on an extended project.

What Should Happen?

Messages sent after idle periods should be processed normally. SessionEnd should only fire when explicitly closing a session.

Error Messages/Logs

2025-12-19 10:46:57.736 [info] From claude: 2025-12-19T18:46:57.735Z [DEBUG] Getting matching hook commands for Stop with query: undefined
2025-12-19T18:46:57.735Z [DEBUG] Found 0 hook matchers in settings
2025-12-19T18:46:57.736Z [DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)

[~24 minute idle gap]

2025-12-19 11:10:35.514 [info] Received message from webview: {"type":"io_message","channelId":"a7yfbw0ga9w","message":{"type":"user"...

2025-12-19 11:10:35.528 [info] From claude: 2025-12-19T19:10:35.528Z [DEBUG] Getting matching hook commands for SessionEnd with query: other

2025-12-19 11:10:35.528 [info] From claude: 2025-12-19T19:10:35.528Z [DEBUG] Found 0 hook matchers in settings
2025-12-19T19:10:35.528Z [DEBUG] Matched 0 unique hooks for query "other" (0 before deduplication)

2025-12-19 11:10:35.549 [info] From claude: 2025-12-19T19:10:35.549Z [DEBUG] Cleaned up session snapshot: /Users/donro/.claude/shell-snapshots/snapshot-zsh-1766169390944-qgz0sx.sh

2025-12-19 11:10:35.549 [info] From claude: 2025-12-19T19:10:35.549Z [DEBUG] LSP server manager shut down successfully

2025-12-19 11:10:35.567 [info] Closing Claude on channel: a7yfbw0ga9w
2025-12-19 11:10:35.568 [error] Error from Claude (on channel a7yfbw0ga9w): Error: Claude Code process exited with code 1


**Key observation:** Only 14 milliseconds elapsed between receiving the user message (11:10:35.514) and SessionEnd firing (11:10:35.528). The session appears to terminate before processing begins.

Steps to Reproduce

  1. Open a project in VSCode with Claude Code extension
  2. Have an active chat session with some history
  3. Work normally for a period, including compaction when needed
  4. Leave the session idle for ~15-25 minutes
  5. Send a new message
  6. Session terminates with code 1 error

Additional Context

  • The CLI (claude command) works perfectly - this is isolated to the VSCode extension
  • Restarting VSCode recovers the session (minus the last message that triggered the crash)
  • Issue frequency has increased over ~2 weeks of active use
  • Project involves frequent compaction due to context limits
  • Right before the idle period, logs showed "SLOW OPERATION DETECTED" warnings for file system operations (fs.existsSync 9.4ms, fs.readFileSync 27.4ms)
  • This bug report has been generated with the help of Claude Opus 4.5

Possible Cause

The session connection may be going stale during idle periods. When a new message arrives, the extension detects the broken connection and fires SessionEnd instead of reconnecting or handling the stale state gracefully.

Claude Model

Claude Sonnet (via Claude Code chat mode)

Is this a regression?

Unclear - first noticed after ~2 weeks of use, may correlate with session age/complexity. Is happening more and more often

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.72 (Claude Code)

Platform

Other

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Claude Model

Claude Sonnet (via Claude Code chat mode)

Is this a regression?

Unclear - first noticed after ~2 weeks of use, may correlate with session age/complexity. Is happening more and more often

Claude Code Version

2.0.72 (Claude Code)

VSCode Extension Version

v2.0.65

Platform

macOS

Operating System

Sequoia 15.6.1 (24G90)

Terminal/Shell

zsh (VSCode integrated terminal)

View original on GitHub ↗

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