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
- 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
UserPromptSubmitfires
Environment
- Codex CLI v0.116.0
- macOS
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗