Summary
On Windows, the generated Codex hook commands from @superbased/observer are wrapped in POSIX-style single quotes. Codex executes these hook commands through cmd.exe, which does not treat '...' as valid quoting. As a result, the hook command is parsed incorrectly and exits with code 1.
Environment
- OS: Windows
- Codex CLI:
0.133.0
@superbased/observer: 1.6.27
Generated hook command
Example from hooks.json:
"command": "'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\@superbased\\observer\\node_modules\\@superbased\\observer-win32-x64\\bin\\observer.exe' hook codex SessionStart --config 'C:\\Users\\Administrator\\.observer\\config.toml'"
The same quoting pattern was generated for PermissionRequest, PreToolUse, PostToolUse, SessionStart, Stop, and UserPromptSubmit.
Reproduction
- Install
@superbased/observer on Windows.
- Configure Codex hooks using the current install flow.
- Start Codex or submit a prompt.
- The hook fails immediately.
Running the generated command through cmd.exe reproduces the problem:
cmd /c "'C:\Users\Administrator\AppData\Roaming\npm\node_modules\@superbased\observer\node_modules\@superbased\observer-win32-x64\bin\observer.exe' hook codex SessionStart --config 'C:\Users\Administrator\.observer\config.toml'"
Actual behavior
The command fails under cmd.exe because the single quotes are interpreted literally instead of as quoting. In my case this caused the hook to error immediately, and Codex showed hook failures on prompt submission / session start.
Expected behavior
On Windows, generated Codex hook commands should use Windows-safe quoting:
- no single quotes around executable/config paths
- if quoting is required, use
"..." for cmd.exe compatibility
Workaround
Manually editing hooks.json to remove the single quotes fixed it. For example, this form works:
"command": "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\@superbased\\observer\\node_modules\\@superbased\\observer-win32-x64\\bin\\observer.exe hook codex SessionStart --config C:\\Users\\Administrator\\.observer\\config.toml"
After removing the single quotes, the affected Codex hooks executed successfully.
Summary
On Windows, the generated Codex hook commands from
@superbased/observerare wrapped in POSIX-style single quotes. Codex executes these hook commands throughcmd.exe, which does not treat'...'as valid quoting. As a result, the hook command is parsed incorrectly and exits with code1.Environment
0.133.0@superbased/observer:1.6.27Generated hook command
Example from
hooks.json:The same quoting pattern was generated for
PermissionRequest,PreToolUse,PostToolUse,SessionStart,Stop, andUserPromptSubmit.Reproduction
@superbased/observeron Windows.Running the generated command through
cmd.exereproduces the problem:Actual behavior
The command fails under
cmd.exebecause the single quotes are interpreted literally instead of as quoting. In my case this caused the hook to error immediately, and Codex showed hook failures on prompt submission / session start.Expected behavior
On Windows, generated Codex hook commands should use Windows-safe quoting:
"..."forcmd.execompatibilityWorkaround
Manually editing
hooks.jsonto remove the single quotes fixed it. For example, this form works:After removing the single quotes, the affected Codex hooks executed successfully.