anthropics / anthropics/claude-code
[BUG] VS Code extension: SDK launch never completes — Interrupted during launch / sdk_stream_ended_no_result (CLI works; macOS 27)
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet (related but distinct: #91773 Remote-SSH; #82197 second-session spawn; closed #69600 / #46094 similar symptoms on other setups)
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code (`claude --version` → **2.1.273**; VS Code extension package was **2.1.272** at time of the log capture below)
### What's Wrong?
In the **VS Code Claude Code panel**, sessions never finish **SDK launch**. Auth succeeds (OAuth tokens found in secure storage). The Output channel logs `Launching Claude on channel: …`, the webview can send user `io_message`s, but **no assistant stream ever starts** (no first token). Cancelling yields `Interrupted during launch` and `sdk_stream_ended_no_result` (`had_error: true`). Reproduced with a one-word `Test` prompt as well as a longer prompt.
Same machine / same account: **CLI print-mode works** (`claude -p 'Reply with exactly: OK'` → `OK` in ~7s). Failure is the **extension → SDK subprocess launch** path, not Anthropic API/auth.
Also frequent: `Channel not found for logEvent: ` (webview events before the channel exists). One launch closed ~3s after `Launching` with no user interrupt.
### What Should Happen?
SDK launch completes; channel becomes ready; user messages stream an assistant reply (or a clear, immediate launch failure with a useful error). Interrupt should not be the only way to discover that launch never finished.
### Error Messages/Logs
```text
[info] OAuth tokens found in secure storage
[info] launch_claude … cwd= permissionMode=auto thinkingLevel=default_on
[info] Launching Claude on channel: 2gcwlk39553
[info] io_message … text: "Test"
[info] generate_session_title …
… (minutes: no stream / no ready)
[info] interrupt_claude
[info] Closing Claude on channel: 2gcwlk39553
[info] generateSessionTitle failed: Error: Interrupted during launch
[info] log_event sdk_stream_ended_no_result had_error=true message_count=1
[warning] Channel not found for logEvent: 2gcwlk39553
```
Longer stuck attempt (~78s before interrupt) behaved identically. Separate attempt also logged `Failed to get usage Error: Interrupted during launch` and `Error processing client request: Error: Interrupted during launch`. After reload: `Loading config cache by launching Claude (no channel)...` in parallel with a channel launch; remote session list still works (`Fetched 43 remote sessions`).
### Steps to Reproduce
1. On macOS 27.0 (Apple Silicon), install Claude Code VS Code extension (~2.1.272) with CLI 2.1.27x.
2. Open a folder in VS Code (here: a git worktree under a larger repo) and open the Claude Code panel.
3. Wait for `Launching Claude on channel: …` in the Claude Code Output channel.
4. Send any prompt once the composer accepts input (e.g. `Test`).
5. Observe: spinner / no assistant tokens for minutes; Output stays in launch with no stream.
6. Stop / interrupt → `Interrupted during launch` + `sdk_stream_ended_no_result`.
7. Control: in Terminal, `claude -p 'Reply with exactly: OK' --output-format text` → succeeds.
### Claude Model
Not sure / Multiple models (never reached a live turn; launch options in log: `thinkingLevel: "default_on"`)
### Is this a regression?
I don't know
### Last Working Version
Unknown (in-extension feedback form also failed: would not accept paste into the input field — filing here instead)
### Claude Code Version
`2.1.273 (Claude Code)` CLI; VS Code extension `anthropic.claude-code` **2.1.272** at log time
### Platform
Anthropic API (OAuth / Claude.ai subscription tokens via secure storage)
### Operating System
macOS **27.0** (Darwin 27.0.0, build 26A428), arm64
### Terminal/Shell
VS Code (Claude Code panel / extension webview — not the integrated terminal TUI). Shell path resolve logged: `/bin/zsh` → 40 entries. Launch cwd example: a local git worktree. Launch flags from logs: `permissionMode: "auto"`, `thinkingLevel: "default_on"`, `freshStartIfUnresumable: false`.
### Additional Information
- **VS Code:** 1.137.0 (`645f29cc…`), arm64
- **Ruled out locally:** missing OAuth; API unreachable (CLI `-p` OK); PTY exhaustion (`lsof /dev/ptmx` holders low); slow UserPromptSubmit/SessionStart hooks when run from a normal shell (<50ms each). SessionStart hook present: iTerm2 `cc-status` (unlikely proven cause; noted for completeness).
- **Related issues (symptoms overlap, setup differs):** #91773 (`sdk_stream_ended_no_result` over Remote-SSH); #82197 (second session never spawns); closed #69600 / #46094 (`Interrupted during launch` on other Mac setups). This report is **local** VS Code on **macOS 27**, CLI healthy, launch never completes.
- Happy to attach a fuller Output dump or try a diagnostic build.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the VS Code Claude Code panel and its Output channel, comparing the extension-to-SDK subprocess launch logs with the working CLI print-mode command. Reproduce on macOS 27 using the listed versions and trace the launch through channel creation and the first stream; done means the channel becomes ready and prompts stream a reply, or launch fails immediately with a useful error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100