#[non_exhaustive]pub enum Event {
Show 15 variants
PreToolUse,
PostToolUse,
Notification,
UserPromptSubmit,
Stop,
SubagentStop,
PreCompact,
SessionStart,
SessionEnd,
PermissionRequest,
PermissionDenied,
ConfigChange,
FileChanged,
InstructionsLoaded,
Custom(String),
}Expand description
Lifecycle event to attach to. Each integration maps this to its harness’s
own event name (e.g., PreToolUse on Claude Code, BeforeTool on Gemini,
tool.execute.before on OpenCode).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PreToolUse
Fire before a tool call is executed (the most common case; lets the hook modify or block the call).
PostToolUse
Fire after a tool call completes.
Notification
Hook fires when a notification event is dispatched.
UserPromptSubmit
Hook fires when user submits a prompt.
Stop
Hook fires when the agent stops.
SubagentStop
Hook fires when a subagent stops.
PreCompact
Hook fires before message compaction.
SessionStart
Hook fires when a session starts.
SessionEnd
Hook fires when a session ends.
PermissionRequest
Hook fires when a permission request is initiated.
PermissionDenied
Hook fires when a permission is denied.
ConfigChange
Hook fires when configuration changes.
FileChanged
Hook fires when a file is changed.
InstructionsLoaded
Hook fires when instructions are loaded.
Custom(String)
Pass through a custom event name verbatim.
Implementations§
Trait Implementations§
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.