How-To Series · Episode 40 / 59 · Module 6: Working While You Sleep
Hermes · Event Hooks
When X happens, run Y. Log, block, format, alert.
After this videoYou can now inject custom behavior at Hermes lifecycle points.
Three hook systems run custom code at lifecycle points: gateway hooks (gateway-only, alerts/webhooks), plugin hooks (CLI + gateway, Python, guardrails), and shell hooks (CLI + gateway, any script). All are non-blocking, a broken hook never crashes the agent. Shell hooks are the easy path: add a hooks: block in config pointing at a script, which gets JSON on stdin and answers on stdout. Three powers: pre_tool_call blocks a tool, post_tool_call reacts after (e.g. auto-format on write), pre_llm_call injects context. They run with your full credentials, so the first time Hermes sees a new event-and-command pair it asks for approval.
About these resources. Every command in this video comes from the Event Hooks doc.
Sources · What this video distills
1 docs page · every command below traces to one of themCommands shown · Copy and paste
each shows the source doc it came fromhooks.post_tool_call: [{matcher: "write_file|patch", command: "~/.hermes/agent-hooks/auto-format.sh"}]hooks.pre_tool_call: [{matcher: "terminal", command: "~/.hermes/agent-hooks/block-rm-rf.sh"}]hermes hooks list · hermes hooks doctorGoing deeper · Related Hermes docs
further reading · not sources of facts shown aboveNext in the series · Episodes that build on this
E39
Kanban Board
E34
Webhooks
E36
Schedule With Cron