Hook Event Reference

Wire Protocol

Claude Code → stdin JSON → athena-hook-forwarder → UDS NDJSON → Athena runtime

The forwarder reads the hook event from stdin, writes it as a single NDJSON line to the Unix Domain Socket, and exits. For blocking events, the forwarder waits for a response before exiting.

Exit code 0 = passthrough. Exit code 2 = block.

Auto-passthrough timeout: 5 seconds default, 5 minutes for permission/question events.

Event Envelope

type RuntimeEvent = {
  id: string;
  timestamp: number;
  kind: RuntimeEventKind;
  data: object;
  sessionId: string;
  context: object;
  interaction: { expectsDecision: boolean };
}

Tool Events

Require a "*" matcher to receive all tool calls.

PreToolUse

WhenBefore Claude invokes a tool
RuntimeEventKindtool.pre
Can blockYes
Blocking responsepassthrough, block (with reason), or json (structured)

PostToolUse

WhenAfter a tool completes and returns its result
RuntimeEventKindtool.post
Can blockNo

PostToolUseFailure

WhenAfter a tool invocation results in an error
RuntimeEventKindtool.failure
Can blockNo

PermissionRequest

WhenClaude Code requests explicit permission for a tool
RuntimeEventKindpermission.request
Can blockYes
Blocking responsepassthrough (allow) or block (deny)

Non-Tool Events

SessionStart

WhenNew Claude Code session begins
RuntimeEventKindsession.start

SessionEnd

WhenClaude Code session ends
RuntimeEventKindsession.end

UserPromptSubmit

WhenUser submits a prompt
RuntimeEventKinduser.prompt

Stop

WhenClaude Code's stop hook fires
RuntimeEventKindstop.request

SubagentStart

WhenA subagent session starts
RuntimeEventKindsubagent.start

SubagentStop

WhenA subagent session ends
RuntimeEventKindsubagent.stop

Notification

WhenInformational notification from Claude Code
RuntimeEventKindnotification

PreCompact

WhenBefore context compaction occurs
RuntimeEventKindcompact.pre

Setup

WhenSession init or maintenance
RuntimeEventKindsetup

Feed Event Kinds

Runtime events are expanded into display events:

session.start, session.end, run.start, run.end, user.prompt, tool.pre, tool.post, tool.failure, permission.request, permission.decision, stop.request, stop.decision, subagent.start, subagent.stop, notification, compact.pre, setup, unknown.hook, todo.add, todo.update, todo.done, agent.message, teammate.idle, task.completed, config.change