Skip to content

Hooks — Runtime layer

🌐 日本語

NOTE

Hooks are scripts that fire at defined lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, etc.). They run outside the LLM's context — deterministic checks and side effects that the model never sees.

How it works

  • Defined in settings.json under hooks.<event>.
  • The LLM cannot disable, bypass, or even read its own hooks — that's the point.
  • Best used for guardrails (lint, secret scan, format) that you want to be unskippable.

Structural problems it addresses

See also

Released under the CC BY 4.0 License.