Hooks-Guide logo

Inside The IncredAgents Mod Pack

Rules that fire inside the agent's loop.

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.

A pre-tool-use hook blocking a protected write, plus a silent audit log and the universal safety rules
Get It On GitHub → Back To All Skills

The interception points

Six Moments Where Rules Can Live.

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.

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.

The Ledger.

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.

The Survivor.

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

A Broken Hook Must Never Break The Agent.

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.

Per-Platform Truth.

Hermes, Claude Code, Codex, Cursor, OpenCode, Continue, Aider, Cline — what each platform actually supports, not what their marketing implies.

Workarounds For The Rest.

No native hooks? Rule files, wrapper scripts, pre-commit hooks, post-hoc audit — the guide tells you which fallback each platform gets.

Battle-Tested Patterns Included.

Pre-dispatch validation, post-converge logging, compaction survival — with working code, not pseudocode.

Get started

Put Your Rules Where They Can't Be Ignored.

Ships in the mod pack. Reference it the next time you need a gate, a log, or a checkpoint.

your machine — three commands

$ 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.

Governance inside the loop beats policy docs.

The next rule you write will actually fire.

Get Hooks-Guide On GitHub →