Make it yours
Hooks: your own command around every tool call
Before a tool runs or after it has — a shell command of yours that checks, fixes or reports, with a ten-second ceiling.
A hook is a shell command that runs before or after every tool call the model makes: refuse a command before it runs, format a file that was just written, or tell you something happened.
- File
%APPDATA%\Aetox\hooks.json- Two moments
PreToolUse(before — can refuse the call) ·PostToolUse(after — cannot undo, but can reject the result)- matcher
- a glob on the tool name:
shell·write·*·github_*— empty means every tool - Ceiling
- 10 seconds, fixed. A hook sits between the model and its tool, so every call waits for it.
The shape
{
"hooks": [
{ "event": "PreToolUse", "matcher": "shell", "command": "pwsh -File ~/guard.ps1", "blocking": true },
{ "event": "PostToolUse", "matcher": "write", "command": "npx prettier --write $AETOX_TOOL_ARGS" }
]
}blocking: truemakes a non-zero exit refuse the call on PreToolUse, and turn the result into an error for the model on PostToolUse (the work already done is not undone)- The command gets the call as JSON on stdin and the variables
AETOX_TOOL,AETOX_EVENTandAETOX_TOOL_ARGS(plusAETOX_TOOL_OKandAETOX_TOOL_OUTPUTafter the fact), and runs through the same shell as the shell tool with the sandbox root as its working directory - The file is read once when the app starts — a change needs a restart
- A hook imported from another app arrives with its whole command, and a PreToolUse one arrives blocking; see Importing from another app