remote-control: "node: bad option: --sdk-url" when client connects to session
Description
claude remote-control connects successfully, but when a client joins the session, the spawned child process fails with:
node: bad option: --sdk-url
The subprocess is invoked as node ... --sdk-url <url> --session-id <id> ..., but Node interprets --sdk-url as a Node flag rather than an application argument, causing immediate failure.
Steps to Reproduce
- Run
claude remote-control --verbose - Session connects and displays a URL
- Open the session URL from another device
- Session immediately fails with:
node: bad option: --sdk-url
Verbose log output:
Session started: "Session session_01BZJHf5g6CVyp6fg9eQMkhJ" (session_01BZJHf5g6CVyp6fg9eQMkhJ)
Debug log: /var/folders/.../bridge-session-session_01BZJHf5g6CVyp6fg9eQMkhJ.log
/opt/homebrew/Cellar/node@22/22.22.0_1/bin/node: bad option: --sdk-url
Session failed: /opt/homebrew/Cellar/node@22/22.22.0_1/bin/node: bad option: --sdk-url session_01BZJHf5g6CVyp6fg9eQMkhJ
Expected Behavior
The remote session should start successfully and allow interaction from the connected client.
Environment
- Claude Code: 2.1.63
- Node.js: Tested on v20.20.0, v22.22.0, and v25.6.1 — all fail
- OS: macOS Darwin 25.3.0 (arm64)
- Installation: npm global via Homebrew
Root Cause
In cli.js, the child process is spawned with --sdk-url as an argument to node without a -- separator. Modern Node versions reject unknown flags. Adding -- before application arguments would fix this:
// Current (fails):
node --sdk-url <url> --session-id <id> ...
// Fix:
node -- cli.js --sdk-url <url> --session-id <id> ...
Verified that adding -- before the script path resolves the issue:
$ node --sdk-url test # fails: bad option
$ node -- cli.js --sdk-url test # worksThis issue has 4 comments on GitHub. Read the full discussion on GitHub ↗