Expand description
External process-based hooks.
External hooks are executable scripts/programs placed in hook directories
(~/.recursive/hooks/ or <workspace>/.recursive/hooks/). They receive
a JSON event on stdin and must reply with a JSON decision on stdout within
5 seconds. Timeout or non-parseable output is treated as “continue”.
§Protocol
Input (stdin, single line JSON):
{
"event": "preToolCall",
"toolName": "run_shell",
"args": {"command": "rm -rf /"},
"mode": "ask"
}Output (stdout, single line JSON):
{"action": "continue"}
{"action": "skip", "message": "dangerous command"}
{"action": "error", "message": "not allowed"}Re-exports§
pub use crate::hooks::HookAction;
Structs§
- External
Hook Runner - Discovers and runs external hook executables.
- Hook
Input - Input payload sent to the external hook on stdin.
- Hook
Result - Rich result returned by a hook dispatch, containing the primary action as well as optional structured metadata for the caller to consume.
Enums§
- Hook
Event - The kind of lifecycle event sent to the external hook.
- Permission
Decision - Permission decision returned by a hook.