Skip to main content

Module hooks

Module hooks 

Source
Expand description

Hook system.

Hooks allow user-defined actions to run at specific points in the agent lifecycle:

  • PreToolUse — before a tool executes (can block/modify)
  • PostToolUse — after a tool completes
  • SessionStart — when a session begins
  • SessionStop — when a session ends
  • UserPromptSubmit — when the user submits input

Hooks can be shell commands, HTTP endpoints, or prompt templates, configured in the settings file.

Re-exports§

pub use crate::config::HookAction;
pub use crate::config::HookDefinition;
pub use crate::config::HookEvent;

Structs§

HookRegistry
Hook registry that stores and dispatches hooks.
HookResult
Result of executing a hook.