Skip to content

Windows: spawning claude via child_process fails (ENOENT/EINVAL) due to missing .cmd handling #91489

Description

@Vilard7

Environment

  • OS: Windows 10 (10.0.19045)
  • Node.js: child_process spawn

Summary

On Windows 10, spawning the claude command via Node.js child_process fails with ENOENT and EINVAL errors. The .cmd extension is not appended to the resolved command, and shell: true is not set for .cmd/.bat files.

On Windows, executables installed as npm-style shims (like claude) are .cmd files. Node's child_process.spawn will not locate claude without the .cmd extension (→ ENOENT), and starting Windows batch files (.cmd/.bat) without shell: true throws EINVAL on recent Node.js versions.

Root cause

File: supervisor-Cw-nY4TI.js

  1. resolveCommand: the cmdCommands list does not include "claude", so the command is not resolved to claude.cmd.
  2. createChildAdapter: shell: true is not set for commands ending in .cmd or .bat, which is required to launch batch files on Windows.

Suggested fix

  1. Add "claude" to cmdCommands in resolveCommand.
  2. In createChildAdapter, set shell: true when the resolved command ends with .cmd or .bat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions