Expand description
Hook configuration schema and loader.
Hooks can be configured via a hooks.json file in ~/.recursive/ or
<workspace>/.recursive/. The file maps event names to lists of hook
matchers, each of which may filter by tool name / argument prefix.
§Example hooks.json
{
"PreToolCall": [
{
"matcher": "run_shell(git *)",
"hooks": [
{ "type": "command", "command": "~/.recursive/hooks/git-check.sh", "timeout": 10 }
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{ "type": "command", "command": "~/.recursive/hooks/log-prompt.sh", "async": true }
]
}
]
}Structs§
- Hook
Command - A single hook command entry.
- Hook
Matcher - A hook matcher: an optional filter condition plus the hooks to run.
- Hooks
Config - Top-level hook configuration, loaded from
hooks.json.
Enums§
- Hook
Command Type - Supported hook execution types.
Functions§
- load_
hooks_ config - Load
HooksConfigfrom the firsthooks.jsonfound indirs. - matches_
hook - Returns
trueifinput_tool/argssatisfy the given matcher pattern.