Hooks

Hooks run OpenCanon after edits and return findings to the agent.

Supported hosts

  • Claude Code: PostToolUse feedback hook.
  • OpenCode: post-write feedback hook.
  • Codex: PostToolUse feedback hook.

Install

hook install
sh
opencanon hook install --all --dry-run
opencanon hook install --all

--dry-run prints the planned configuration without writing.

What the agent sees

Hooks return findings: rule, severity, location, decision link, and optional fix suggestion. The agent reads them as tool output.

Failure mode

Hooks fail fast. If the daemon or engine is missing, the hook reports a diagnostic instead of doing a partial run.