remote-control fails on Windows: "bad option: --sdk-url" — bridge spawner missing script path

Resolved 💬 2 comments Opened Mar 4, 2026 by Shavoni Closed Apr 2, 2026

Bug

claude remote-control connects successfully but immediately fails when spawning the bridge session subprocess.

Error

Session failed: C:\Program Files\nodejs\node.exe: bad option: --sdk-url session_01SCCicFoSag35ksgqvY9nm9

Root Cause

The bridge session factory spawns a child process like:

spawn(process.execPath, ["--print", "--sdk-url", sdkUrl, "--session-id", ...], { ... })

This is missing the CLI script path (cli.js) as the first element of the args array. Without it, Node.js interprets --print and --sdk-url as Node.js flags instead of arguments to the Claude CLI script. Node rejects --sdk-url as an unknown flag.

The fix is to prepend process.argv[1] (the script path) to the args array:

spawn(process.execPath, [process.argv[1], "--print", "--sdk-url", ...], { ... })

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Claude Code: 2.1.66
  • Node.js: Tested on both v22.22.0 and v24.13.1 — same failure on both
  • Shell: Git Bash / PowerShell

Steps to Reproduce

  1. claude remote-control on Windows
  2. Session connects (shows URL)
  3. Immediately fails with "bad option: --sdk-url"

Notes

  • The /remote-control slash command from inside a session has the same issue
  • The Commander.js subcommand dispatch elsewhere in the codebase correctly prepends the script path — this is only the bridge spawner that's missing it

View original on GitHub ↗

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