UserPromptSubmit and SessionStart hooks fire simultaneously on first prompt

Resolved 💬 5 comments Opened Mar 20, 2026 by disrupt-labs-core Closed Apr 10, 2026

Bug

When both SessionStart and UserPromptSubmit hooks are registered, they fire simultaneously on the first prompt. On subsequent prompts, only UserPromptSubmit fires (expected).

Expected behavior

SessionStart should complete before UserPromptSubmit fires on the first prompt, or they should not overlap — since the first prompt is both a session start event and a prompt submit event.

Steps to reproduce

  1. 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 }]
      }
    ]
  }
}
  1. Start Codex CLI with codex -c features.codex_hooks=true
  2. Send the first prompt — both hooks fire simultaneously
  3. Send a second prompt — only UserPromptSubmit fires

Environment

  • Codex CLI v0.116.0
  • macOS

View original on GitHub ↗

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