remote-control: "node: bad option: --sdk-url" when client connects to session

Resolved 💬 4 comments Opened Feb 28, 2026 by AIABG Closed Mar 29, 2026

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

  1. Run claude remote-control --verbose
  2. Session connects and displays a URL
  3. Open the session URL from another device
  4. 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  # works

View original on GitHub ↗

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