HookInput
Passed via stdin toget-session-id and read-session.
| Field | Type | Required | Description |
|---|---|---|---|
hook_type | string | Yes | session_start, session_end, user_prompt_submit, stop, pre_tool_use, post_tool_use |
session_id | string | Yes | Agent session identifier |
session_ref | string | Yes | Agent-specific session reference (typically a file path) |
timestamp | string | Yes | RFC 3339 timestamp |
user_prompt | string | No | User’s prompt text |
tool_name | string | No | Tool name (from tool use hooks) |
tool_use_id | string | No | Tool invocation ID |
tool_input | object | No | Raw tool input JSON |
raw_data | object | No | Agent-specific extension data |
AgentSession
Used as input towrite-session and output from read-session.
| Field | Type | Description |
|---|---|---|
session_id | string | Agent session identifier |
agent_name | string | Agent registry name |
repo_path | string | Absolute path to the repository |
session_ref | string | Path to session in agent’s storage |
start_time | string | RFC 3339 timestamp |
native_data | bytes/null | Opaque session content in agent’s native format |
modified_files | string[] | Files modified during the session |
new_files | string[] | Files created during the session |
deleted_files | string[] | Files deleted during the session |
Event
Returned byparse-hook. Represents a normalized lifecycle event.
| Value | Name | Description |
|---|---|---|
| 1 | SessionStart | Agent session has begun |
| 2 | TurnStart | User submitted a prompt |
| 3 | TurnEnd | Agent finished responding |
| 4 | Compaction | Context window compression (triggers save + offset reset) |
| 5 | SessionEnd | Session terminated |
| 6 | SubagentStart | A subagent was spawned |
| 7 | SubagentEnd | A subagent completed |
previous_session_id, session_ref, prompt, model, timestamp, tool_use_id, subagent_id, tool_input, subagent_type, task_description, response_message, metadata.
Only type and session_id are required.