Skip to content

Agent Hooks System

.md

Hooks (internal/hooks/types.go) allow operators to intercept the agent loop at defined lifecycle checkpoints:

  • session_start — Fires when a new agent session is established.
  • user_prompt_submitBLOCKING: Evaluates or mutates prompt input before entering the pipeline.
  • pre_tool_useBLOCKING: 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_startBLOCKING: Authorizes sub-agent spawning.
  • subagent_stop — Finalizes sub-agent task completion.