[BUG] Claude Code CLI: claude remote-control fails with node: bad option: --sdk-url on npm-global install
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
What's Wrong?
Claude Code CLI
claude remote-control immediately fails because the bridge spawns a child process where --sdk-url is passed as a Node.js flag rather than an application argument. The child process exits with code 9 (invalid V8 option).
Regular claude usage works fine — only the remote-control subcommand is affected.
Environment
- Claude Code version: 2.1.58
- Installation method: npm global (
npm install -g @anthropic-ai/claude-code) - Node.js: v22.22.0 (via nvm)
- OS: Debian Linux
- Terminal: bash
Root Cause Analysis
The bridge spawns a child claude process with args --print --sdk-url wss://... --session-id .... Exit code 9 indicates Node.js is rejecting --sdk-url as an invalid V8 flag, meaning the arguments are being passed to the node binary itself rather than to the Claude Code script entry point. The script path appears to be missing between the Node executable and the application arguments in the child spawn call.
This likely only affects npm-global installations (where claude is a Node shim) and does not reproduce with native binary installs.
What Should Happen?
Expected Behavior
claude remote-control should successfully start a remote session and display a QR code / session URL.
Error Messages/Logs
## Debug Log (relevant section)
[bridge:session] Spawning sessionId=session_01UG7DhCQa2ksRpYZjw6v8MB sdkUrl=wss://api.anthropic.com/v1/session_ingress/ws/session_01UG7DhCQa2ksRpYZjw6v8MB accessToken=present
[bridge:session] Child args: --print --sdk-url wss://api.anthropic.com/v1/session_ingress/ws/session_01UG7DhCQa2ksRpYZjw6v8MB --session-id session_01UG7DhCQa2ksRpYZjw6v8MB --input-format stream-json --output-format stream-json --replay-user-messages
[bridge:session] sessionId=session_01UG7DhCQa2ksRpYZjw6v8MB pid=205996
[bridge:session] sessionId=session_01UG7DhCQa2ksRpYZjw6v8MB failed exit_code=9 pid=205996
Steps to Reproduce
Steps to Reproduce
- Install Claude Code globally via npm under nvm
- Run
claude remote-control - Accept the prompt
- Session fails immediately
Error Output
[12:19:52] Session failed: /home/owner/.nvm/versions/node/v22.22.0/bin/node: bad option: --sdk-url session_01UG7DhCQa2ksRpYZjw6v8MB
[12:19:52] To reconnect: claude --resume session_01UG7DhCQa2ksRpYZjw6v8MB
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.58
Platform
Other
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗