AI agent deep dives

Agent hooks 101: PreToolUse / PostToolUse

Six lifecycle points, each can run a shell script: audit, cache, block, rewrite.

Kition Team·Feb 18, 2026·8 min read

Where it lives

In `<vault>/.kition/hooks.json`. A typical config is ~50 lines and travels with the vault — survives machine swaps and team handoffs.

Example: audit every web_fetch

{
  "PreToolUse": {
    "web_fetch": ".kition/scripts/log-fetch.sh"
  }
}

When to use each

  • PreToolUse: intercept / rewrite / deny a call
  • PostToolUse: cache, transform, report
  • SessionStart: bootstrap (pull latest schemas)
  • Stop: clean up, persist results
  • UserPromptSubmit: translate user input into your DSL
  • Notification: push alerts to Slack

Ready when you are.

Kition is a local-first AI workspace. Markdown documents, structured tables, and an AI agent — running on your own machine, against the model provider you choose.