返回 DeepSeek-Reasonix
1 # Hooks
2
3 ### Events and blocking
4
5 Use `/hooks` or Diagnostics → Hooks for the resolved events and sources. Tool and stop failures have separate events: `PostToolUseFailure` and `StopFailure`.
6
7 Native `PreToolUse` and `UserPromptSubmit` hooks can block progress. Imported Claude `PermissionRequest` hooks also deny the action on exit 2 or timeout; check the hook's payload format before interpreting a failure.
8
9 ### Sources
10
11 - Project: `<workspace>/.reasonix/settings.json` — loaded automatically
12 - Plugin packages: installed enabled packages
13 - Global: `<Reasonix home>/settings.json` (always)
14
15 Match field is an **anchored** regex: `file` does **not** match `read_file`; use `.*file` or `*`. Native timeout values are **milliseconds**: defaults are 5s for `PreToolUse`, `PermissionRequest`, and `UserPromptSubmit`, and 30s otherwise.
16
17 ### Checks
18
19 `/hooks`, Settings → Hooks, Diagnostics → Hooks.
20
21 ### Symptom → cause → fix
22
23 | Symptom | Cause | Fix |
24 | --- | --- | --- |
25 | Project hooks silent | Wrong workspace / restart required | Confirm the project path and restart Reasonix after saving |
26 | Matcher never fires | Non-anchored assumption / bad regex | Fix match (`hook.invalid_matcher`) |
27 | Command missing | Empty command / missing context file | Fix settings entry |
28 | Malformed JSON | Invalid settings.json | Repair JSON (file yields no hooks, no crash) |
29
29 lines MARKDOWN