[BUG] Remote Control fails on Node.js v22: "bad option: --sdk-url"

Resolved 💬 3 comments Opened Feb 26, 2026 by jjackkun Closed Mar 1, 2026

Bug Description

claude rc (remote control) fails immediately with bad option: --sdk-url on Node.js v22.

Error Output

[13:39:27] Session failed: /home/user/.nvm/versions/node/v22.20.0/bin/node: bad option: --sdk-url session_01VAxHfUTP9AqCGjY4XAvkH6
[13:39:27] To reconnect: claude --resume session_01VAxHfUTP9AqCGjY4XAvkH6

Root Cause Analysis

The bridge session spawning code passes CLI flags (--print, --sdk-url, --session-id, etc.) directly to process.execPath (the Node.js binary) via spawn(), without including the CLI script path in the args array.

Node.js v22 has stricter option parsing than v20, causing it to reject --sdk-url as an unknown Node.js flag before the script even executes.

Relevant minified source reference:

// Bridge session spawn
let O = njz(A.execPath, $, { cwd: K, stdio: ["pipe","pipe","pipe"], env: H, windowsHide: true });
// where A.execPath = process.execPath (node binary)
// and $ = ["--print", "--sdk-url", sdkUrl, "--session-id", sessionId, ...]

Environment

  • Claude Code version: 2.1.59
  • Node.js version: v22.20.0 (via nvm)
  • OS: Ubuntu Linux (6.14.0-37-generic)
  • Platform: x86_64

Steps to Reproduce

  1. Install Node.js v22 via nvm
  2. npm install -g @anthropic-ai/claude-code@latest
  3. Run claude rc
  4. Enable Remote Control → session immediately fails

Expected Behavior

Remote Control session should start successfully regardless of Node.js v22.

Workaround

Switching to Node.js v20 and reinstalling Claude Code works, but this requires changing the system Node.js version which is not ideal.

View original on GitHub ↗

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