remote-control fails with "bad option: --sdk-url" on Node.js v24 (Windows)
Description
claude remote-control immediately fails with a Node.js error on Windows 11 with Node.js v24.
Error
[03:59:14] Session failed: C:\Program Files\nodejs\node.exe: bad option: --sdk-url session_0188xqojn3EZLtXNe4ngpMpL
[03:59:14] To reconnect: claude --resume session_0188xqojn3EZLtXNe4ngpMpL
Root Cause Analysis
The bridge session spawner uses A.execPath which resolves to node.exe on Windows. The child process is spawned as:
node.exe --print --sdk-url <url> --session-id <id> --input-format stream-json --output-format stream-json --replay-user-messages
Node.js v24 interprets --sdk-url as a Node.js flag (not a script argument), causing immediate failure. The --print flag is also a Node.js built-in flag (node --print / node -p), which means Node expects the next argument to be a JS expression to evaluate — not --sdk-url.
The relevant minified code in cli.js:
let O = njz(A.execPath, $, { cwd: K, stdio: ["pipe","pipe","pipe"], env: H, windowsHide: true });
Where $ contains ["--print", "--sdk-url", q.sdkUrl, "--session-id", ...] and A.execPath resolves to C:\Program Files\nodejs\node.exe.
Environment
- Claude Code: 2.1.59
- Node.js: v24.13.0
- OS: Windows 11 Pro (10.0.26200.7922)
- Shells tested: Git Bash and PowerShell (same error in both)
Steps to Reproduce
- Install Node.js v24 on Windows 11
- Install Claude Code 2.1.59 (
npm install -g @anthropic-ai/claude-code) - Run
claude remote-control - Enable remote control when prompted ("y")
- Session immediately fails with "bad option: --sdk-url"
Expected Behavior
Remote control session starts successfully and generates a QR code / URL for connecting from another device.
Additional Context
The issue is likely that execPath should point to the Claude Code CLI entry point (e.g., cli.js via the npm wrapper), not to node.exe directly. When node.exe receives --print, it enters expression evaluation mode and treats all subsequent arguments differently.
This may also affect other features that spawn child processes with --print flag (e.g., teammates/agents).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗