[BUG] Windows: claude-cli:// deep link terminal opens and immediately closes (no interactive session)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Clicking a claude-cli://open?q=... deep link on Windows triggers the browser's "Open Claude Code" dialog correctly, but after clicking through, a terminal window opens and closes immediately. No interactive Claude Code session is left running.
This applies even to the minimal case: claude-cli://open?q=hello — no session opens.
What Should Happen?
A terminal window should open with Claude Code running and the q text pre-filled in the input box, waiting for user input (as documented).
Environment
- Claude Code version: 2.1.228
- OS: Windows 11 Home 10.0.26200
- Shell: PowerShell / Windows Terminal
- Install path:
C:\Users\<user>\.local\bin\claude.exe - Registry handler:
"C:\Users\<user>\.local\bin\claude.exe" --handle-uri "%1"atHKCU\SOFTWARE\Classes\claude-cli\shell\open\command
Steps to Reproduce
- Ensure
claudehas been run interactively at least once (handler is registered) - Open Claude Desktop app
- Paste
claude-cli://open?q=hellointo browser address bar and press Enter - Browser shows "Open Claude Code?" dialog — click "Open Claude Code"
- A terminal flashes briefly and disappears. No Claude session remains open.
claude started directly from a fresh Windows Terminal works correctly and stays open.
Process capture
Monitoring process creation at 50ms intervals while triggering the deep link showed the following new processes appear and immediately exit:
10:10:53.607 claude PID=3016 ← new claude process spawned by handler
10:10:53.608 conhost PID=25068
10:10:53.765 conhost PID=31656
10:10:53.765 conhost PID=32732
... (further conhost processes, all exit within ~2 seconds)
Windows Terminal (PID=4908) was already running but no new tab was opened. Instead of attaching to the existing Windows Terminal, the handler spawned legacy conhost windows that immediately closed — consistent with #14828 / #70200 (subprocess spawn without CREATE_NO_WINDOW), but in this case the terminal that is meant to remain open also exits.
Related Issues
- #59824, #78335 —
/desktopcommand fails to open Claude Desktop on Windows (same launch plumbing) - #14828, #70200 — conhost flash on Windows subprocess spawns