SessionStart not firing on session start instead it fires on first user prompt submission

Resolved 💬 2 comments Opened Mar 20, 2026 by shanraisshan Closed Mar 20, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.116.1

What subscription do you have?

Plus

Which model were you using?

gpt-5.4 xhigh

What platform is your computer?

mac

What terminal emulator and version are you using (if applicable)?

_No response_

What issue are you seeing?

SessionStart not firing on session start instead it fires on first user prompt submission. When both SessionStart and UserPromptSubmit hooks are registered, they fire simultaneously on the first prompt. On subsequent prompts, only UserPromptSubmit fires (expected).

What steps can reproduce the bug?

Register both hooks in .codex/hooks.json:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [{ "type": "command", "command": "echo 'SessionStart fired'", "timeout": 10 }]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [{ "type": "command", "command": "echo 'UserPromptSubmit fired'", "timeout": 10 }]
      }
    ]
  }
}

Start Codex CLI with codex -c features.codex_hooks=true
Send the first prompt — both hooks fire simultaneously
Send a second prompt — only UserPromptSubmit fires

What is the expected behavior?

SessionStart should fire on session start and not on first user prompt submission

Additional information

implementation: https://github.com/shanraisshan/codex-cli-hooks

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 5 months ago

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

  • #15266

Powered by Codex Action

oxysoft · 3 months ago

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.