hermes-hooks
Skill4 starsChanged 7 months agoMITView on GitHub
Use when managing shell hooks in Hermes. Covers: hermes hooks CLI (list, test, revoke, doctor), hook configuration in config.yaml, shell-hooks-allowlist.json, first-use consent, hook events (pre/post), hook patterns, hook security. Triggers on: hooks, shell hooks, pre-hook, post-hook, automation, trigger.
In this repository22 other files it gives its agents.
- hermes-channelsSkill
- hermes-cliSkill
- hermes-conceptsSkill
- hermes-configSkill
- hermes-cronSkill
- hermes-delegationSkill
- hermes-gatewaySkill
- hermes-installSkill
- hermes-loggingSkill
- hermes-masterSkill
- hermes-mcpSkill
- hermes-memorySkill
- hermes-platformsSkill
- hermes-providersSkill
- hermes-securitySkill
- hermes-skill-authoringSkill
- hermes-skillsSkill
- hermes-soulSkill
- hermes-toolsSkill
- hermes-troubleshootingSkill
- hermes-voiceSkill
- hermitdoc-onboardingSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 102
Not in allowlist — hermes hooks list to check
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hermes Hooks Reference
Shell script hooks — run custom scripts at specific points in Hermes execution.
Hooks CLI
hermes hooks list # List configured hooks (matcher, timeout, consent status)
hermes hooks test EVENT # Fire every hook matching EVENT against a synthetic payload
hermes hooks revoke COMMAND # Remove a command's allowlist entries
hermes hooks doctor # Diagnose each hook: exec bit, allowlist, mtime drift, JSON validity, timingHook Configuration
# ~/.hermes/config.yaml
hooks:
- name: "pre-terminal"
event: "pre_tool_call"
matcher: "terminal"
command: "/path/to/hook.sh"
timeout_seconds: 5
allowlist: true # pre-approved (no prompt needed)
- name: "post-terminal"
event: "post_tool_call"
matcher: "terminal"
command: "/path/to/hook2.sh"
timeout_seconds: 5Hook Events
| Event | When it fires |
pre_tool_call | Before a tool is called |
post_tool_call | After a tool completes |
pre_agent_loop | Before agent loop iteration |
post_agent_loop | After agent loop iteration |
Hook Environment Variables
| Variable | Contents |
HERMES_TOOL | Tool being called (e.g. terminal) |
HERMES_TOOL_ARGS | Tool arguments (JSON) |
HERMES_EXIT | Exit status |
HERMES_SESSION_ID | Current session ID |
First-Use Consent
First time a hook fires, Hermes prompts for consent. Decisions are stored in:
~/.hermes/shell-hooks-allowlist.jsonManage the allowlist:
# Test hooks (fires against synthetic payload)
hermes hooks test pre_tool_call
# Revoke allowlist entries for a command
hermes hooks revoke "/path/to/hook.sh"Hook Security
- Allowlist — hooks don't fire until approved
- Timeout — prevents hanging hooks
- Event filtering — use
matcherto target specific tools
Hook Doctor
hermes hooks doctor
# Checks each hook:
# - Exec bit set
# - Allowlist status
# - File modification time drift
# - JSON validity of config
# - Synthetic run timingCommon Issues
Hook not firing:
- Not in allowlist —
hermes hooks listto check - Wrong event type — verify event in config
- File not executable —
chmod +x
Hook blocking execution:
- Exit 1 blocks the tool call
- Fix the hook or
hermes hooks revoke
References
hermes-security/— allowlist managementhermes-cli/— hooks CLI commandshermes-logging/— audit logging
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

