Describe the bug
On Windows, running /codex:review via Claude Code fails immediately with:
Codex CLI is not installed or is missing required runtime support. Install it with \`npm install -g @openai/codex\`, then rerun \`/codex:setup\`.
The Codex CLI IS installed and codex --version works in a terminal, but the companion script's runCommand() uses spawnSync without shell: true, which cannot resolve codex on Windows because Node's spawnSync without shell does not expand PATH on Windows.
To Reproduce
- Have Codex CLI installed (
npm install -g @openai/codex)
- Run
codex --version in PowerShell — confirms it works
- Run
/codex:review in Claude Code on Windows
- Observe the "not installed" error
Root Cause
In scripts/lib/process.mjs, the runCommand function uses spawnSync without shell: true:
export function runCommand(command, args = [], options = {}) {
const result = spawnSync(command, args, {
cwd: options.cwd,
env: options.env,
encoding: "utf8",
input: options.input,
stdio: options.stdio ?? "pipe"
});
On Windows, spawnSync without shell: true cannot resolve commands in the user PATH (like codex installed via npm global). The shell is required to expand PATH.
Evidence
// Without shell — ENOENT on Windows
spawnSync('codex', ['--version'], { stdio: 'pipe' })
// { error: { code: 'ENOENT', syscall: 'spawnSync codex', path: 'codex' } }
// With shell — works fine
spawnSync('codex', ['--version'], { shell: true, stdio: 'pipe' })
// { status: 0, stdout: 'codex-cli 0.118.0' }
Suggested Fix
In scripts/lib/process.mjs, add shell: true for Windows:
export function runCommand(command, args = [], options = {}) {
const result = spawnSync(command, args, {
cwd: options.cwd,
env: options.env,
encoding: "utf8",
input: options.input,
stdio: options.stdio ?? "pipe",
shell: process.platform === 'win32' // <-- fix
});
Environment
- OS: Windows 11
- Node.js: v24.12.0
- Codex CLI: 0.118.0
- Plugin: openai-codex via Claude Code plugin
Reported by: Thepushpendra68
Describe the bug
On Windows, running
/codex:reviewvia Claude Code fails immediately with:The Codex CLI IS installed and
codex --versionworks in a terminal, but the companion script'srunCommand()usesspawnSyncwithoutshell: true, which cannot resolvecodexon Windows because Node'sspawnSyncwithout shell does not expand PATH on Windows.To Reproduce
npm install -g @openai/codex)codex --versionin PowerShell — confirms it works/codex:reviewin Claude Code on WindowsRoot Cause
In
scripts/lib/process.mjs, therunCommandfunction usesspawnSyncwithoutshell: true:On Windows,
spawnSyncwithoutshell: truecannot resolve commands in the user PATH (likecodexinstalled via npm global). The shell is required to expand PATH.Evidence
Suggested Fix
In
scripts/lib/process.mjs, addshell: truefor Windows:Environment
Reported by: Thepushpendra68