claude-code-generic-hooks
v0.1.13
Published
Claude Code Generic Hooks CLI
Readme
Claude Generic Hooks
Commands
store
claude-code-generic-hooks store /path/to/db.sqliteStores hook metadata in an SQLite database
yolo
claude-code-generic-hooks yoloAutoapproves everything except for accepting a plan. Similar to --dangerously-skip-permissions but works in plan mode.
activity
Track Claude Code work sessions activity with desktop notifications
activity start
claude-code-generic-hooks activity start /path/to/activity.dbStarts tracking a new activity session
activity stop
claude-code-generic-hooks activity stop /path/to/activity.dbStops the current activity session
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"
}
]
}
]
}
}Activity command - Track work sessions with notifications:
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks activity start ~/.claude/activity.db"
}
]
}
],
"PostToolUse": [
{
"matcher": "ExitPlanMode",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks activity start ~/.claude/activity.db"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx claude-code-generic-hooks activity stop ~/.claude/activity.db"
}
]
}
]
}
}