Two root causes of spawn EINVAL on Windows: 1. process.env spread can include undefined values. Windows child_process.spawn requires all env values to be strings. sanitizeEnv now builds a clean object, dropping non-string entries. 2. Claude CLI installed via npm creates .cmd wrappers that cannot be spawned without shell:true. Detect .cmd/.bat extensions and fall back to SDK's internal resolution instead. Bump version to 0.10.7. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>