【BUG】Codex CLI hooks fail silently on Linux/Windows when editing large files

Open 💬 2 comments Opened Apr 16, 2026 by peckfly

What version of the Codex App are you using (From “About Codex” dialog)?

latest (0.121.0)

What subscription do you have?

Pro

What platform is your computer?

Linux / Windows

What issue are you seeing?

On Linux and Windows, when Codex edits a large file (roughly >100KB or >1500-2000 lines), the preToolUse/postToolUse hooks fail silently and never execute.

The hook input payload includes the full file content, which exceeds OS-level argument size limits:

  • Linux: E2BIG (MAX_ARG_STRLEN = 128KB)
  • Windows: ENAMETOOLONG (command-line length limit ~32KB)

This does NOT occur on macOS.

What steps can reproduce the bug?

  1. Configure a tool hook (e.g. preToolUse / postToolUse) in hooks.json
  2. Use Codex to edit a file with >1500-2000 lines (or >100KB in size)
  3. Observe that the hook process is never spawned — no output, no error in the terminal

What is the expected behavior?

Hooks should fire regardless of file size. The hook input should be passed entirely via stdin pipe rather than command-line arguments or environment variables.

Additional information

Editing smaller files (e.g. <50KB) in the same session works correctly — hooks fire successfully. macOS is not affected by this issue.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗