Agent Hooks System
Agent Hooks System
Section titled “Agent Hooks System”Hooks (internal/hooks/types.go) allow operators to intercept the agent loop at defined lifecycle checkpoints:
Supported Hook Events
Section titled “Supported Hook Events”session_start— Fires when a new agent session is established.user_prompt_submit— BLOCKING: Evaluates or mutates prompt input before entering the pipeline.pre_tool_use— BLOCKING: Intercepts tool calls before execution to enforce security policies or human approval.post_tool_use— Non-blocking post-execution observation and logging.stop— Fires upon session completion.subagent_start— BLOCKING: Authorizes sub-agent spawning.subagent_stop— Finalizes sub-agent task completion.