Docs: hookSpecificOutput schema incomplete - missing SessionStart event
Resolved 💬 2 comments Opened Jan 30, 2026 by omar-elmountassir Closed Feb 28, 2026
Summary
The hook JSON output validation error message shows an incomplete schema for hookSpecificOutput. It only lists three event types, but SessionStart also supports additionalContext injection and works correctly.
Current Schema (from error message)
"hookSpecificOutput": {
"for PreToolUse": { ... },
"for UserPromptSubmit": { "hookEventName": "\"UserPromptSubmit\"", "additionalContext": "string (required)" },
"for PostToolUse": { "hookEventName": "\"PostToolUse\"", "additionalContext": "string (optional)" }
}
Missing Event
SessionStart supports hookSpecificOutput with additionalContext injection, but it's not documented in the schema. This hook works correctly:
const output = {
hookSpecificOutput: {
hookEventName: 'SessionStart',
additionalContext: '...' // This gets injected into context
}
};
console.log(JSON.stringify(output));
Impact
When developers see the error message schema, they assume only PreToolUse/UserPromptSubmit/PostToolUse support hookSpecificOutput. This caused confusion when implementing hooks for other events.
Suggested Fix
Update the schema documentation (and error messages) to include all events that support hookSpecificOutput:
- PreToolUse
- UserPromptSubmit
- PostToolUse
- SessionStart (missing)
Environment
- Claude Code CLI
- Pop!_OS 24.04 LTS
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗