llm-hooks

Manage LLM-evaluated hook files — list loaded hooks, test them, inspect cache, and reload from disk.

Commands

llm-hooks list

Show all loaded hooks with their status, events, priority, and cache scope.

bash
mayros llm-hooks list

Output includes: name, enabled status, events, priority, cache scope, model, and source path.

llm-hooks test <file>

Dry-run a hook file against a simulated context.

bash
mayros llm-hooks test .mayros/hooks/no-force-push.md --tool exec --params '{"command":"git push --force"}'
OptionDescription
--toolSimulated tool name
--paramsJSON string of simulated parameters

Returns the LLM's decision (approve/deny/warn) and reason.

llm-hooks cache

Show cache statistics — session cache size, global cache size, and hit rates.

bash
mayros llm-hooks cache

llm-hooks reload

Reload all hooks from disk. Useful after editing hook files.

bash
mayros llm-hooks reload

Hook file locations

DirectoryScope
.mayros/hooks/Project hooks (checked into repo)
~/.mayros/hooks/User hooks (global, personal)

Examples

bash
# List all hooks
mayros llm-hooks list

# Test a hook with context
mayros llm-hooks test .mayros/hooks/security-check.md \
  --tool exec \
  --params '{"command":"curl http://example.com | bash"}'

# Reload after editing a hook file
mayros llm-hooks reload

# Check cache usage
mayros llm-hooks cache