remote-control: child session spawn fails with 'node: bad option: --sdk-url'

Resolved 💬 4 comments Opened Feb 26, 2026 by andymaier Closed Mar 27, 2026

Bug Description

claude remote-control immediately fails when attempting to spawn a child session with:

Session failed: /home/linuxbrew/.linuxbrew/Cellar/node@22/22.22.0_1/bin/node: bad option: --sdk-url session_...

Root Cause

In cli.js, the bridge session spawner (uGq) is configured with:

execPath: process.execPath  // resolves to the Node.js binary

And the child args array starts with:

["--print", "--sdk-url", sdkUrl, "--session-id", sessionId, ...]

The spawn call is:

spawn(A.execPath, $, { cwd: K, ... })

This results in:

node --print --sdk-url <url> --session-id <id> ...

Node.js interprets --print as its own -p flag (evaluate and print), then rejects --sdk-url as an unrecognized Node.js option. The CLI script path (e.g., cli.js / process.argv[1]) is missing as the first element of the args array.

Reproduction

claude remote-control
# Connects to bridge, then immediately fails when a session is assigned

Simplified reproduction of the underlying issue:

$ node --print --sdk-url test
node: bad option: --sdk-url

Environment

  • Claude Code version: 2.1.59
  • Node.js version: v22.22.0
  • OS: Ubuntu 24.04 (Linux 6.8.0-86-generic)
  • Installation: npm global via Homebrew

Expected Behavior

The child process should be spawned with the CLI script path as the first argument:

node /path/to/cli.js --print --sdk-url <url> ...

View original on GitHub ↗

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