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
- Windows 11 with Node.js managed via fnm (or any npm global install)
- Install Codex globally:
npm install -g @openai/codex - Install the Codex plugin in Claude Code
- Run
/codex:setup— succeeds (usesprocess.mjswhich hasshell: true) - Run
/codex:adversarial-review— fails withspawn 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