[BUG] Remote Control fails on Windows npm installation: "bad option: --sdk-url"

Resolved 💬 3 comments Opened Feb 24, 2026 by coop-markt Closed Mar 27, 2026

Description

claude rc (Remote Control) fails immediately on Windows when Claude Code is installed via npm.

Error

Session failed: C:\Program Files\nodejs\node.exe: bad option: --sdk-url session_013kp1FsJVzK1WpnPxmompxN

Root Cause

The bridge session spawner uses process.execPath (the Node.js binary) as the command to spawn child sessions:

let l = IPq({ execPath: process.execPath, env: process.env, ... });
// later:
let O = spawn(A.execPath, ["--print", "--sdk-url", url, "--session-id", id, ...], { ... });

On an npm installation, process.execPath is the Node.js binary itself (C:\Program Files\nodejs\node.exe), so this results in:

spawn("C:\Program Files\nodejs\node.exe", ["--print", "--sdk-url", <url>, ...])

Node.js interprets --print as its own -p flag and then rejects --sdk-url as an unrecognized Node.js option.

The codebase already has helper functions (internally named _c4() / gc4() in minified code) that correctly resolve the CLI path for npm installations by returning process.argv[1] instead of process.execPath when not running as a Bun binary, but the bridge initialization doesn't use them.

Environment

  • OS: Windows 10/11 (MSYS/Git Bash), MSYS_NT-10.0-26200
  • Node.js: v22.19.0
  • Claude Code: 2.1.52 (installed via npm install -g @anthropic-ai/claude-code)

Steps to Reproduce

  1. Install Claude Code via npm on Windows: npm install -g @anthropic-ai/claude-code
  2. Run claude rc or claude remote-control
  3. Enable Remote Control when prompted
  4. Observe the bad option: --sdk-url error and immediate session failure

Expected Behavior

Remote Control session should start successfully and connect to the web/app interface.

Suggested Fix

Use the resolved CLI executable path (via the existing helper that returns process.argv[1] for npm installs) instead of raw process.execPath when spawning bridge child sessions.

View original on GitHub ↗

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