Problem
On Windows, the spawn("codex", ["app-server"], ...) call in scripts/lib/app-server.mjs (line ~188) fails with ENOENT because codex is installed as a batch/cmd wrapper (e.g. codex.cmd). Node.js child_process.spawn on Windows requires shell: true to resolve .cmd/.bat extensions via PATH.
Additionally, when shell: true is set, a visible cmd.exe console window briefly flashes on screen. Setting windowsHide: true prevents this.
Environment
- Windows 11 Pro (10.0.22631)
- Node.js v22.x
- Codex CLI installed globally via npm
- Claude Code plugin
codex@openai-codex v1.0.1
Current code
this.proc = spawn("codex", ["app-server"], {
cwd: this.cwd,
env: this.options.env,
stdio: ["pipe", "pipe", "pipe"]
});
Suggested fix
this.proc = spawn("codex", ["app-server"], {
cwd: this.cwd,
env: this.options.env,
stdio: ["pipe", "pipe", "pipe"],
shell: process.platform === "win32",
windowsHide: true
});
shell is conditionally enabled only on Windows so Unix behavior is unchanged. windowsHide is a no-op on non-Windows platforms.
Steps to reproduce
- Install Codex CLI globally on Windows (
npm i -g @openai/codex)
- Enable the
codex@openai-codex plugin in Claude Code
- Invoke
/codex:rescue with any task
- Observe
ENOENT error — spawn codex ENOENT
Problem
On Windows, the
spawn("codex", ["app-server"], ...)call inscripts/lib/app-server.mjs(line ~188) fails withENOENTbecausecodexis installed as a batch/cmd wrapper (e.g.codex.cmd). Node.jschild_process.spawnon Windows requiresshell: trueto resolve.cmd/.batextensions viaPATH.Additionally, when
shell: trueis set, a visiblecmd.execonsole window briefly flashes on screen. SettingwindowsHide: trueprevents this.Environment
codex@openai-codexv1.0.1Current code
Suggested fix
shellis conditionally enabled only on Windows so Unix behavior is unchanged.windowsHideis a no-op on non-Windows platforms.Steps to reproduce
npm i -g @openai/codex)codex@openai-codexplugin in Claude Code/codex:rescuewith any taskENOENTerror —spawn codex ENOENT