You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(windows): resolve real claude.exe so SDK skips broken fallback
In our standalone CJS bundle (what install.ps1 deploys), esbuild emits
'var import_meta = {};' because CJS has no native import.meta. The Agent
SDK fallback at sdk.mjs:63 then crashes with fileURLToPath(undefined)
when pathToClaudeCodeExecutable is omitted - which was the case on
Windows since claudePathForSdk() returned undefined to dodge CVE-2024-
27980 spawn EINVAL on .cmd shims.
Fix: on Windows, derive the real claude.exe from npm's claude.cmd
shim location (<dir>\node_modules\@Anthropic-AI\claude-code\bin\
claude.exe) and pass that to the SDK. .exe is unaffected by CVE-2024-
27980 (only .cmd/.bat trigger spawn EINVAL), and bypassing the SDK
broken fallback means the import.meta.url stub doesn't matter.
claudePathForSdk() simplified to findClaudePath() - uniform across
Linux/macOS/Windows, no platform special-case (D-136).
Verified Azure Win11 Pro 24H2 native (Standard_D2s_v5, Node 20.20.2,
Claude Code 2.1.123, standalone bundle deployed exactly as install.ps1
would):
- axme-code setup --force real OAuth: 10 LLM + 13 presets = 23
decisions, 0.59 USD, 117s, zero errors (was 0 LLM + 13 presets + 4x
fileURLToPath TypeError before fix)
- claude --print --dangerously-skip-permissions with Write tool:
notes.md created, PreToolUse + PostToolUse + SessionEnd all fired
- Detached audit worker: session_end -> check_result PASS ->
audit_complete (0.137 USD)
Linux: npm test 511/511 pass, no regression.
Prior 2026-04-17 'Windows verified' actually tested via dist/+
node_modules path (SDK loaded as ESM from disk so import.meta.url was
defined and the SDK fallback worked). The standalone bundle path -
what install.ps1 actually deploys - was never E2E-tested on Windows
before today because v0.2.9 had no Windows binaries.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments