[BUG] `claude remote-control` fails with "node: bad option: --sdk-url"
Description
claude remote-control connects successfully but the session immediately fails with:
Session failed: /opt/homebrew/Cellar/node/25.6.1_1/bin/node: bad option: --sdk-url <session_id>
Root Cause Analysis
In the bridge session spawner (RPq function in cli.js), the child process is spawned as:
spawn(process.execPath, ["--print", "--sdk-url", sdkUrl, "--session-id", sessionId, ...], ...)
process.execPath resolves to the Node.js binary (e.g. /opt/homebrew/Cellar/node/25.6.1_1/bin/node), so --print and --sdk-url are interpreted as Node.js flags rather than Claude CLI arguments. Node.js does not recognize --sdk-url and exits with "bad option".
It appears the spawn should target the Claude CLI script (e.g. cli.js) rather than process.execPath directly, or pass the CLI script path as the first argument before the flags.
Steps to Reproduce
- Install Claude Code v2.1.53 via
npm install -g @anthropic-ai/claude-code - Run
claude remote-control - Session connects, then immediately fails
Environment
- Claude Code version: 2.1.53
- Node.js: Tested with v22.22.0 and v25.6.1 (same error on both)
- OS: macOS (Darwin 25.2.0, Apple Silicon)
- Installation: Homebrew Node.js + npm global install
Expected Behavior
claude remote-control should spawn a child Claude session successfully.
Actual Behavior
·✔︎· Connected · <username> · HEAD
Continue coding in the Claude app or https://claude.ai/code/<session_id>?bridge=<env_id>
[HH:MM:SS] Session failed: /opt/homebrew/Cellar/node/25.6.1_1/bin/node: bad option: --sdk-url <session_id>This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗