HookEvent
HookEvent =
object
Defined in: src/hooks-ingest.ts:28
A normalized hook event after validation — the spike’s observable unit.
Properties
Section titled “Properties”agentId?
Section titled “agentId?”
optionalagentId?:string
Defined in: src/hooks-ingest.ts:60
SubagentStart/Stop: the spawned sub-agent’s stable agent_id (same id in both).
agentType?
Section titled “agentType?”
optionalagentType?:string
Defined in: src/hooks-ingest.ts:62
SubagentStart/Stop: the sub-agent’s agent_type (e.g. “general-purpose”, “Explore”).
event:
"PostToolUse"|"PostToolUseFailure"|"Notification"|"SessionStart"|"Stop"|"SessionEnd"|"SubagentStart"|"SubagentStop"|string
Defined in: src/hooks-ingest.ts:31
Recognized lifecycle event; an unrecognized hook_event_name is still kept,
passed through verbatim, and flagged via unknown.
exitCode?
Section titled “exitCode?”
optionalexitCode?:number
Defined in: src/hooks-ingest.ts:48
PostToolUse(/Failure): tool exit code when present (logging aid).
match?
Section titled “match?”
optionalmatch?:boolean
Defined in: src/hooks-ingest.ts:71
Route-decided cross-check of the body’s session_id against the resolved
session’s claudeSessionId. false ⇒ observe-only (never forwarded to signals).
message?
Section titled “message?”
optionalmessage?:string
Defined in: src/hooks-ingest.ts:52
Notification: the human-readable message string.
notificationType?
Section titled “notificationType?”
optionalnotificationType?:string
Defined in: src/hooks-ingest.ts:50
Notification: the notification_type string (e.g. permission_prompt / idle_prompt).
reason?
Section titled “reason?”
optionalreason?:string
Defined in: src/hooks-ingest.ts:58
SessionEnd: the termination reason (clear/logout/prompt_input_exit/other).
receivedAt
Section titled “receivedAt”receivedAt:
number
Defined in: src/hooks-ingest.ts:68
Server receive time (ms). CC’s payload carries no reliable client timestamp, so end-to-end latency is measured externally; this anchors per-event ordering + logs.
sessionId
Section titled “sessionId”sessionId:
string
Defined in: src/hooks-ingest.ts:42
The hook payload’s session_id (== claude --session-id == claudeSessionId).
source?
Section titled “source?”
optionalsource?:string
Defined in: src/hooks-ingest.ts:54
SessionStart: the source (startup/resume/clear/compact).
status?
Section titled “status?”
optionalstatus?:"ok"|"error"
Defined in: src/hooks-ingest.ts:46
PostToolUse(/Failure): derived from exit_code / the *Failure event.
stopHookActive?
Section titled “stopHookActive?”
optionalstopHookActive?:boolean
Defined in: src/hooks-ingest.ts:56
Stop: the stop_hook_active boolean (whether a Stop hook is already active).
toolName?
Section titled “toolName?”
optionaltoolName?:string
Defined in: src/hooks-ingest.ts:44
PostToolUse(/Failure): the tool that ran.
unknown?
Section titled “unknown?”
optionalunknown?:boolean
Defined in: src/hooks-ingest.ts:65
True when hook_event_name or notification_type was unrecognized — recorded,
flagged, and console.warn-ed so a wrong upstream string surfaces in the spike.