Skip to main content

Module hook

Module hook 

Source
Expand description

The Claude Code PreToolUse hook protocol: turn a stdin envelope into a steering decision.

Functions§

decision
Build the PreToolUse decision JSON for a Steer under mode.
process
Process a raw PreToolUse stdin envelope. Returns the decision JSON to print, or None to allow silently. The Bash command is classified by analyze; the harness’s own Grep / Glob / Read calls are steered from their structured fields. Fail-open: any parse error, an unhandled tool, or a missing field all yield None.