Skip to content

Hooks do not fire in interactive sessions (v0.125.0) #19780

Closed as not planned
Closed as not planned

Description

@Riku4230

Summary

Hooks configured in ~/.codex/hooks.json (global) and .codex/hooks.json / .codex/config.toml (project-level) do not fire in interactive sessions on Codex CLI v0.125.0.

Environment

  • Codex CLI version: v0.125.0
  • OS: macOS Darwin 24.6.0 (Apple Silicon)
  • Shell: zsh

Feature flag status

codex_hooks    stable    true

Confirmed via codex features list.

What I tried

1. Project-level hooks.json

my-project/.codex/hooks.json
my-project/.codex/config.toml  (with [features] codex_hooks = true)

Codex shows the warning: loading hooks from both .codex/hooks.json and .codex/config.toml — confirming files are discovered — but no hooks fire.

2. Project-level config.toml (TOML format)

[features]
codex_hooks = true

[[hooks.SessionStart]]

[[hooks.SessionStart.hooks]]
type = "command"
command = "touch /tmp/codex_hook_fired"
timeout = 10

File /tmp/codex_hook_fired is never created.

3. Global ~/.codex/hooks.json

Added hooks to the global ~/.codex/hooks.json. Same result — hooks are loaded (no error) but never execute.

4. Minimal test

Reduced to the absolute minimum:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "touch /tmp/codex_hook_fired"
          }
        ]
      }
    ]
  }
}

Started codex, exited. /tmp/codex_hook_fired does not exist.

5. CLI flag

codex --enable codex_hooks

Same result.

Expected behavior

SessionStart hook should execute touch /tmp/codex_hook_fired on session startup, creating the file.

Actual behavior

No hooks fire. No errors in output. Hook configuration is silently loaded but never executed.

Context

I'm building a project management harness (PM-Harness) that uses hooks for schema validation (PreToolUse), session context injection (SessionStart), and feedback loops (Stop). It works with Claude Code and I'm adding Codex CLI support. The hook scripts are ready and dual-compatible, but blocked by this issue.

Possibly related to #17532.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    hooksIssues related to event hooks
    on Apr 27, 2026
  2. github-actions commented on Apr 27, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

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

    CLIIssues related to the Codex CLIbugSomething isn't workinghooksIssues related to event hooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions