[BUG] Windows: claude-cli:// deep link terminal opens and immediately closes (no interactive session)

Status Open
Reported on v2.1.228
Maintainer reply None cached
Activity 0 comments · opened Aug 12, 2026

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" at HKCU\SOFTWARE\Classes\claude-cli\shell\open\command

Steps to Reproduce

  1. Ensure claude has been run interactively at least once (handler is registered)
  2. Open Claude Desktop app
  3. Paste claude-cli://open?q=hello into browser address bar and press Enter
  4. Browser shows "Open Claude Code?" dialog — click "Open Claude Code"
  5. 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 — /desktop command fails to open Claude Desktop on Windows (same launch plumbing)
  • #14828, #70200 — conhost flash on Windows subprocess spawns

View original on GitHub ↗