claude-code - 💡(How to fix) Fix [FEATURE] [VSCode] Support array form for claudeProcessWrapper, OR pass literal "claude" as argv[1] — composition forces compiled shims on Windows

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

  • Linux / macOS shell alias (alias claude=/usr/local/bin/wrapper claude, per #10500) — works for claudeCode.useTerminal: true mode on Linux / macOS only. Not applicable on Windows (no equivalent shell-alias mechanism visible to child_process.spawn).
  • 5-line bash shebang shim — works on macOS/Linux because Node.js CVE-2024-27980 only affects Windows. No .cmd/.bat equivalent on Windows.
  • Standalone native .exe shim — currently the only working Windows path. The shim drops argv[1] and re-invokes the real wrapper with claude prepended. Verified working, but a high-friction per-machine setup step that every Windows developer would otherwise duplicate.

Fix Action

Fix / Workaround

A workaround is for user compiles additional native PE-format .exe shim that configures their args.

  • Linux / macOS users can drop in a 5-line bash-shebang shim that drops argv[1] and re-execs the wrapper. Trivial.
  • Windows users cannot use a .cmd/.bat — Node.js CVE-2024-27980 ("BatBadBut") blocks .bat/.cmd from child_process.spawn without shell: true, which the Claude Code VS Code extension correctly does not set. Result: spawn EINVAL.
  • Windows users also cannot use shell aliases (the workaround the OP of #10500 used on Linux / macOS) — cmd.exe has no aliases, PowerShell aliases aren't visible to child_process.spawn.

Either fix removes the Windows compile step and obsoletes the Linux / macOS shell-script workaround.

Code Example

"claudeCode.claudeProcessWrapper": ["C:\\path\\wrapper.exe", "claude"]

---

"claudeCode.claudeProcessWrapper": ["C:\\path\\wrapper.exe", "claude"]
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Windows-specific UX problem. The claudeCode.claudeProcessWrapper setting in the Claude Code VS Code extension cannot compose with any wrapper CLI that has a subcommand args parser.

The claudeCode.claudeProcessWrapper setting accepts a single executable path — no args. The Claude Code VS Code extension launches the wrapper as <wrapper> <bundled-claude-path> <args...>, passing the resolved path to the Claude Code VS Code extension's bundled claude binary as argv[1]. So a wrapper expecting <wrapper> <args...> won't be able to work.

A workaround is for user compiles additional native PE-format .exe shim that configures their args.

Why Windows-specific when the argv[1] shape itself is cross-platform (same shape reported on Linux in #21565):

  • Linux / macOS users can drop in a 5-line bash-shebang shim that drops argv[1] and re-execs the wrapper. Trivial.
  • Windows users cannot use a .cmd/.bat — Node.js CVE-2024-27980 ("BatBadBut") blocks .bat/.cmd from child_process.spawn without shell: true, which the Claude Code VS Code extension correctly does not set. Result: spawn EINVAL.
  • Windows users also cannot use shell aliases (the workaround the OP of #10500 used on Linux / macOS) — cmd.exe has no aliases, PowerShell aliases aren't visible to child_process.spawn.

Net cost on Windows: every developer who wants to compose Claude Code with their own wrapper CLI has to create their own standalone native .exe shim for args passing.

Proposed Solution

Either of these eliminates the compiled-shim .exe requirement on Windows:

  1. Array form for claudeCode.claudeProcessWrapper — preferred:

    "claudeCode.claudeProcessWrapper": ["C:\\path\\wrapper.exe", "claude"]

    The Claude Code VS Code extension would spawn(array[0], [...array.slice(1), ...claudeArgs]) and skip injecting the bundled-claude path.

  2. Pass the literal string "claude" as argv[1] instead of the resolved bundled-claude path — what naive wrappers expect

Either fix removes the Windows compile step and obsoletes the Linux / macOS shell-script workaround.

Alternative Solutions

Workarounds tried; gaps each leaves on Windows:

  • Linux / macOS shell alias (alias claude=/usr/local/bin/wrapper claude, per #10500) — works for claudeCode.useTerminal: true mode on Linux / macOS only. Not applicable on Windows (no equivalent shell-alias mechanism visible to child_process.spawn).
  • 5-line bash shebang shim — works on macOS/Linux because Node.js CVE-2024-27980 only affects Windows. No .cmd/.bat equivalent on Windows.
  • Standalone native .exe shim — currently the only working Windows path. The shim drops argv[1] and re-invokes the real wrapper with claude prepended. Verified working, but a high-friction per-machine setup step that every Windows developer would otherwise duplicate.

Priority

High - Significant impact on productivity

Feature Category

Developer tools/SDK

Use Case Example

Developer wants to launch Claude Code via the Claude Code VS Code extension's claudeCode.claudeProcessWrapper setting, pointed at a strict-CLI wrapper (org SSO/auth, model router, plugin-aware launcher, etc.) that treats argv[1] as a subcommand.

Today on Windows (Claude Code VS Code extension v2.1.132):

  1. Set claudeCode.claudeProcessWrapper to C:\path\wrapper.exe → "Claude Code process exited with code 2" (the wrapper rejects the bundled-claude path as an unknown subcommand).
  2. Try a .cmd shim that does shift && wrapper claude %*spawn EINVAL (Node.js CVE-2024-27980).
  3. Create a standalone native .exe shim that drops argv[1] and re-invokes wrapper claude <args>. Point claudeCode.claudeProcessWrapper at it. Works.

With proposal #1:

"claudeCode.claudeProcessWrapper": ["C:\\path\\wrapper.exe", "claude"]

No shim, no compile.

Related issues: #21565 (closed by inactivity bot — same argv[1] shape on Linux, Claude Code VS Code extension v2.1.22, wrongly tagged as duplicate of #10506 / #14501), #10500 (closed by OP — POSIX shell-alias workaround for terminal mode), #10491 / #8510 / #10506 / #56013 / #56648 / #13022 (adjacent).

Environment: Claude Code VS Code extension v2.1.132 on Windows x64.

Additional Context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING