pub enum HookKind {
Show 17 variants
PreToolUse,
PostToolUse,
PostToolUseFailure,
UserPromptSubmit,
Stop,
SubagentStop,
SubagentStart,
PreCompact,
Notification,
PermissionRequest,
WorktreeCreate,
WorktreeRemove,
CwdChanged,
FileChanged,
SessionStart,
SessionEnd,
Unknown,
}Expand description
Identifies which hook point a callback is registered for. Sixteen event
kinds mirrored from the CLI v0.1.64, plus
Unknown as a fallback for forward-compatibility.
Variants§
PreToolUse
Before a tool is invoked.
PostToolUse
After a tool completes successfully.
PostToolUseFailure
After a tool errors.
UserPromptSubmit
Every user prompt (can rewrite or cancel).
Stop
End of an assistant turn.
SubagentStop
End of a sub-agent turn.
SubagentStart
Start of a sub-agent turn.
PreCompact
Before session compaction.
Notification
Out-of-band notification to the caller.
PermissionRequest
Permission request observation (distinct from can_use_tool).
WorktreeCreate
Worktree created (LLM called EnterWorktree, or claude spawned with –worktree).
WorktreeRemove
Worktree removed (LLM called ExitWorktree, or claude session ended).
CwdChanged
Session cwd changed (LLM entered/exited a worktree).
FileChanged
External file modification observed by claude’s file-history watcher.
SessionStart
Session lifecycle: init.
SessionEnd
Session lifecycle: end.
Unknown
Fallback for hook events forge-sdk doesn’t yet recognise.
Implementations§
Trait Implementations§
impl Copy for HookKind
impl Eq for HookKind
impl StructuralPartialEq for HookKind
Auto Trait Implementations§
impl Freeze for HookKind
impl RefUnwindSafe for HookKind
impl Send for HookKind
impl Sync for HookKind
impl Unpin for HookKind
impl UnsafeUnpin for HookKind
impl UnwindSafe for HookKind
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.