Skip to main content

Hook reference

This page summarizes the hook events and executor types supported by Kheish.

Hook events

Important hook event families include:
  • tool lifecycle: pre_tool_use, post_tool_use, post_tool_use_failure
  • permission lifecycle: permission_request, permission_denied
  • session lifecycle: setup, session_start, session_end, user_prompt_submit, stop, stop_failure
  • subagent lifecycle: subagent_start, subagent_stop, teammate_idle
  • task lifecycle: task_created, task_completed
  • compaction: pre_compact, post_compact
  • file and runtime changes: file_changed, cwd_changed, instructions_loaded, config_change
  • auxiliary events: elicitation, elicitation_result, notification, worktree_create, worktree_remove

Executor types

Kheish supports these hook executors:
  • command
  • http
  • prompt
  • agent
  • callback

Hook outcome model

Hook handlers can return structured effects such as:
  • continue_execution
  • stop_reason
  • decision
  • permission
  • updated_input
  • updated_output
  • updated_permissions
  • additional_contexts
  • initial_user_message
  • watch_paths
  • retry

Operational guidance

Prefer a small number of well-scoped hooks over a large number of overlapping handlers. Hooks are powerful enough to change runtime policy, mutate execution, and alter observability.