pub struct HookEvent {
pub hook_event_name: HookEventName,
pub session_id: String,
pub cwd: String,
pub permission_mode: String,
pub transcript_path: String,
pub tool_name: Option<String>,
pub tool_input: Option<Value>,
pub tool_response: Option<Value>,
pub tool_use_id: Option<String>,
pub prompt: Option<String>,
pub stop_hook_active: bool,
}Expand description
Hook event received from Claude Code via stdin.
Fields§
§hook_event_name: HookEventNameThe type of hook event (PreToolUse, PostToolUse, etc.)
session_id: StringSession identifier
cwd: StringCurrent working directory
permission_mode: StringPermission mode (default, plan, acceptEdits, dontAsk, bypassPermissions)
transcript_path: StringPath to the transcript file
tool_name: Option<String>Tool name (for PreToolUse/PostToolUse)
tool_input: Option<Value>Tool input parameters (for PreToolUse/PostToolUse)
tool_response: Option<Value>Tool response (for PostToolUse)
tool_use_id: Option<String>Tool use ID
prompt: Option<String>User prompt (for UserPromptSubmit)
stop_hook_active: boolWhether a Stop hook is already active (for Stop/SubagentStop)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HookEvent
impl<'de> Deserialize<'de> for HookEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HookEvent
impl RefUnwindSafe for HookEvent
impl Send for HookEvent
impl Sync for HookEvent
impl Unpin for HookEvent
impl UnwindSafe for HookEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more