Skip to content

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

Open

Description

@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.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Apr 16, 2026
  2. changed the title [-]Codex CLI hooks fail silently on Linux/Windows when editing large files[/-] [+]【BUG】Codex CLI hooks fail silently on Linux/Windows when editing large files[/+] on Apr 16, 2026
  3. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    hooksIssues related to event hooks
    windows-osIssues related to Codex on Windows systems
    on Apr 16, 2026
  4. github-actions commented on Apr 16, 2026

    @github-actions
    Contributor
  5. removed
    CLIIssues related to the Codex CLI
    appIssues related to the Codex desktop app
    on Apr 16, 2026
  6. oxysoft commented on May 8, 2026

    @oxysoft

    Indexed this hook ticket in the umbrella tracker: #21753

    Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghooksIssues related to event hookswindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions