Claude Generic Hooks
August 12, 2025 ยท View on GitHub
Commands
store
claude-code-generic-hooks store /path/to/db.sqlite
Stores hook metadata in an SQLite database
yolo
claude-code-generic-hooks yolo
Autoapproves everything except for accepting a plan. Similar to --dangerously-skip-permissions but works in plan mode.
Example configurations
Store command - Log all hook events to a database:
{
"hooks": {
"PreToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
],
"PostToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
],
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
],
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
],
"SubagentStop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
],
"PreCompact": [
{
"matcher": "manual",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
},
{
"matcher": "auto",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks store ~/.claude/hooks.db"
}
]
}
]
}
}
Yolo command - Auto-approve all tool usage:
{
"hooks": {
"PreToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks yolo"
}
]
}
]
}
}