Skip to content
PHRONEN
Menu

Product

ProductPricingCompanyEnterpriseDownload

Proof

EvidenceSecurity

Account

Sign inCreate accountSalesContact

Hooks

Your own shell commands at fixed points: to check, block or add context.

EventWhen it runs
SessionStarta conversation starts
UserPromptSubmityou send a message, before PHRONEN reads it
PreToolUsebefore a tool runs — can block it
PostToolUseafter a tool ran
StopPHRONEN is about to finish its turn
.phronen/settings.jsonjson
{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Bash", "hooks": [{ "type": "command", "command": "./scripts/check-command.sh", "timeout": 30 }] }
    ],
    "PostToolUse": [
      { "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "npx prettier --write \"$(jq -r .tool_input.file_path)\"" }] }
    ]
  }
}
  • The hook gets a JSON object on stdin: session_id, cwd, event, and — as they apply — tool_name, tool_input, tool_result, prompt.
  • Exit code 2 blocks the action; what the hook wrote to stderr is shown to PHRONEN as the reason.
  • Printing {"decision": "block", "reason": "…"} on stdout does the same; {"additionalContext": "…"} adds context instead.
  • Any other exit lets the action proceed. matcher is a tool name or glob; several are separated by |. timeout is in seconds (default 60).