Functionsยง
- arm_
watchdog - Arms a watchdog that force-exits the process after the given duration. Prevents hook processes from becoming zombies when stdin pipes break or the IDE cancels the call. Since hooks MUST NOT spawn child processes (to avoid orphan zombies), a simple exit(1) suffices.
- handle_
codex_ pretooluse - handle_
codex_ session_ start - handle_
copilot - Dedicated Copilot PreToolUse handler (dispatched via
hook copilot). - handle_
observe - Unified observe handler for all IDE hook events.
Reads JSON from stdin, normalizes to
ObserveEvent, counts tokens, appends tocontext_radar.jsonl, and exits immediately. - handle_
redirect - handle_
rewrite - handle_
rewrite_ inline - Inline rewrite: takes a command as CLI args, prints the rewritten command to stdout. The command is passed as positional arguments, not via stdin JSON.
- load_
active_ transcript - load_
detected_ model - mark_
hook_ environment - Mark this process as a hook child so the daemon-client never auto-starts the daemon from inside a hook (which would create zombie processes).
- model_
context_ window - shell_
quote - Quote a path/arg for shell if it contains spaces or special chars.
- shell_
tokenize - Tokenize a shell command respecting single/double quotes and backslash escapes.