The Gate.
Pre-tool-use hooks block writes to protected paths, banned commands, and out-of-scope actions — with a human-readable reason, not a silent failure.
Inside The IncredAgents Mod Pack
A hook intercepts your agent at the exact moment it matters — before a tool call, after it, at session start, at compaction — and returns allow, block, or modify. Governance without modifying a single line of the agent's source code.
The interception points
Before any tool call. After it completes. Session start. Session end. Compaction. Error. Each one is a chance to enforce, log, or save state — and this guide maps all six to real use.
Pre-tool-use hooks block writes to protected paths, banned commands, and out-of-scope actions — with a human-readable reason, not a silent failure.
Post-tool-use hooks serialize every call — tool, input, exit status, milliseconds — to an audit log. And they never fail, because a logger that breaks the agent is worse than none.
Compaction-survival patterns keep hook state alive when context gets compressed — persistent filenames, checkpoint directories, re-injection on the first post-compaction call.
The safety rules
Fail-open on exceptions. A kill-switch sentinel file that bypasses everything. Idempotent. Five-second timeout. No network calls in pre-tool-use — it fires hundreds of times a session.
Hermes, Claude Code, Codex, Cursor, OpenCode, Continue, Aider, Cline — what each platform actually supports, not what their marketing implies.
No native hooks? Rule files, wrapper scripts, pre-commit hooks, post-hoc audit — the guide tells you which fallback each platform gets.
Pre-dispatch validation, post-converge logging, compaction survival — with working code, not pseudocode.
Get started
Ships in the mod pack. Reference it the next time you need a gate, a log, or a checkpoint.
$ git clone https://github.com/MyAiFreedomSystems/incredagents.git
$ cd incredagents
$ python3 onboard.py
One installer wires in the whole mod pack and asks only for the keys each skill needs.
The next rule you write will actually fire.
Get Hooks-Guide On GitHub →