Expand description
Typed input payloads for each hook event.
Every concrete
input flattens BaseHookInput so callbacks can access session_id,
transcript_path, cwd, and (optionally) permission_mode without
reaching back into super::HookContext.
Re-exportsยง
use serde::Deserialize;๐use serde::Deserialize;๐use serde::Serialize;๐use serde::Serialize;๐use serde_json::Value;๐
Structsยง
- Base
Hook Input - Fields shared by every hook input the CLI emits. Every concrete
input type below flattens this struct so callbacks can access
session_id,transcript_path,cwd, and (optionally)permission_modewithout reaching back intosuper::HookContext. - Effort
Info - Wrapper for the
effortfield on hook inputs. Currently only carrieslevelbut kept as a struct so future fields (budget, adaptive flags, โฆ) can be added without breaking decode-side pattern matches. - Notification
Input - Input payload for
Notification. - Permission
Request Input - Input payload for
PermissionRequest. - Post
Tool UseFailure Input - Input payload for
PostToolUseFailure. - Post
Tool UseInput - Input payload for
PostToolUse. - PreCompact
Input - Input payload for
PreCompact. - PreTool
UseInput - Input payload for
PreToolUse. - Stop
Input - Input payload for
Stop. - Subagent
Context - Optional sub-agent attribution present on tool-lifecycle hook
inputs (
PreToolUse,PostToolUse,PostToolUseFailure,PermissionRequest). Fields are populated when the hook fires inside aTask-spawned sub-agent so tool events can be attributed back to the right agent when multiple sub-agents interleave over the same control channel. - Subagent
Start Input - Input payload for
SubagentStart. - Subagent
Stop Input - Input payload for
SubagentStop. - User
Prompt Submit Input - Input payload for
UserPromptSubmit.