Remote-control / mobile "New session" spawns child via bare node without CLI script path — node: bad option: --sdk-url (iOS hard-crashes)

Resolved 💬 2 comments Opened Jun 22, 2026 by lcwmachine007-create Closed Jun 26, 2026

Reproduced on two OSes / two Node majors. The remote-control / mobile "Code tab → New session" spawn is broken on any install where process.execPath is the raw Node binary (Node.js / npm / nvm — both standard, supported installs). The bridge connects; only the child-session spawn fails.

Environment

| Item | Value |
|---|---|
| Claude Code desktop | 2.1.181 (entrypoint claude-desktop, remote bridge) |
| claude CLI (Windows) | 2.1.181, npm-global shim (Node-based) |
| Node (Windows) | v24.16.0 (official), NODE_OPTIONS empty |
| Node (Linux) | v22.22.0 via nvm |
| Install methods | npm-global (Win) / nvm-managed Node (Linux) — both supported |
| iOS app | 1.260618.0 |
| iOS | 26.5 |
| Device | iPhone 16 Pro Max |
| Plan | Max |
| Latest version checked | ~2.1.185 (no fix) |

Repro 1 — Windows (mobile path), Node v24.16.0 (official install): bridge_state: connected succeeds, then iOS Code tab → New session → iOS app hard-crashes instantly (no dialog/spinner). For contrast, the desktop app's warm/scheduled local sessions spawn the native …\claude-code\2.1.181\claude.exe (empty args) and work fine.

Repro 2 — Linux (CLI, removes iOS), Node v22.22.0 via nvm:

$ claude rc
[22:32:51] Session failed: /home/<user>/.nvm/versions/node/v22.22.0/bin/node: bad option: --sdk-url session_01VbtbVLC5XQ8XAJebo9MfzH
[22:32:51] To reconnect: claude --resume session_01VbtbVLC5XQ8XAJebo9MfzH

Exact arg array the bridge passes:

["--print", "--sdk-url", "<url>", "--session-id", "<id>", "--input-format", "stream-json", "--output-format", "stream-json"]

Not Node-24-specific (reproduces on Node 22 and 24).

Root cause (inferred, matches the #28839 writeup + observed arg array): the spawn omits the CLI script path (process.argv[1]), so on Node/npm/nvm installs process.execPath is raw node and --sdk-url is parsed as a Node flag → node: bad option: --sdk-url. On Bun/native installs process.execPath is the claude executable, so it works. claude --resume reruns the same broken spawn. CLAUDECODE="" is a reported workaround that does not fix the primary error (only a secondary nested-session check).

Expected: spawn the CLI script and start the session; and the iOS app should surface an error on a failed host spawn rather than hard-crashing.

Appears to be the same issue as #28839 and #29693 (both closed as duplicate); also #29687, #30774. No fix confirmed as of ~2.1.185.

View original on GitHub ↗

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