[BUG] VS Code Extension crashes on new session initialization with exit code 1
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?
VS Code Extension crashes on new session initialization with exit code 1
Environment:
- Version: Claude Code 2.0.42 (VS Code Extension)
- OS: macOS (Darwin 25.1.0, Apple Silicon)
- VS Code: Latest version
- Claude Plan: Claude Max
Description
The VS Code extension consistently crashes when attempting to start a new chat session, displaying the error:
Error: Claude Code process exited with code 1
Reproduction Steps
- Open VS Code with Claude Code extension installed
- Click to start a new Claude Code conversation
- Extension immediately crashes with exit code 1
Observed Behavior
- ❌ New chat sessions fail to initialize
- ✅ Existing/resumed chat sessions work perfectly
- ✅ CLI version (
claudecommand) works without issues
Debug Information
From ~/.claude/debug/latest:
[DEBUG] [Query.streamInput] this.sdkMcpTransports.size = 1
[DEBUG] [Query.streamInput] Entering Promise.race to wait for result
[DEBUG] [Query.streamInput] Timed out waiting for first result, closing input stream
[DEBUG] [Query] Calling transport.endInput() to close stdin to CLI process
The extension appears to initialize an MCP transport (size = 1) even when no MCP servers are configured, causing a timeout during session initialization.
Configuration Checked
- ✅
~/.claude/.mcp.jsonis empty{} - ✅
~/.claude/settings.jsonhas no MCP config - ✅ Project
.claude/settings.local.jsonhas no MCP config - ✅ Session cache cleared (
~/.claude/session-env/) - ✅ Extension reinstalled from scratch
- ✅ Extension state deleted (
~/Library/Application Support/Code/User/globalStorage/anthropic.claude-code/) - ✅ Project session files cleaned (168 → 10 files)
Workaround
Using the CLI version (claude command in terminal) works perfectly without any crashes.
Impact
Users cannot start new conversations in VS Code extension, forcing them to use CLI or resume existing sessions only.
Additional Context
This issue persists even after:
- Complete uninstallation and reinstallation of the extension
- Removing all MCP configuration files
- Clearing all caches and session data
- Testing in a clean directory
The fact that existing sessions work suggests this is specifically an initialization bug, not a general compatibility issue.
What Should Happen?
It should just open a new session
Like this:
Error Messages/Logs
Error: Claude Code process exited with code 1
Troubleshooting resources
Steps to Reproduce
Open a new session, and it will appear every time
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.42 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗