Windows: app-server.mjs spawn('codex') fails with ENOENT due to missing shell:true

Open 💬 0 comments Opened Mar 31, 2026 by kyosuke25

Bug Description

On Windows, the Claude Code plugin's codex-companion.mjs fails to start the Codex app-server with spawn codex ENOENT when running adversarial-review or other commands that use the app-server runtime.

Root Cause

In scripts/lib/app-server.mjs line 188, spawn("codex", ["app-server"]) is called without shell: true. On Windows, npm global binaries are installed as .cmd wrappers, and Node.js spawn cannot resolve .cmd files without shell: true.

The fix already exists in scripts/lib/process.mjs line 11 (shell: process.platform === "win32"), but was not applied to app-server.mjs.

Steps to Reproduce

  1. Windows 11 with Node.js managed via fnm (or any npm global install)
  2. Install Codex globally: npm install -g @openai/codex
  3. Install the Codex plugin in Claude Code
  4. Run /codex:setup — succeeds (uses process.mjs which has shell: true)
  5. Run /codex:adversarial-review — fails with spawn codex ENOENT

Fix

// scripts/lib/app-server.mjs line 188
    this.proc = spawn("codex", ["app-server"], {
      cwd: this.cwd,
      env: this.options.env,
-     stdio: ["pipe", "pipe", "pipe"]
+     stdio: ["pipe", "pipe", "pipe"],
+     shell: process.platform === "win32"
    });

Environment

  • OS: Windows 11 (10.0.26200)
  • Node.js: v22.22.0 (managed via fnm)
  • codex-cli: 0.117.0
  • Claude Code plugin: codex 1.0.1

View original on GitHub ↗