Defined in hooks/hooks.json
{
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "if [ -f .piggytales/state/pending-approval.json ]; then echo '๐ทโ PiggyTales: Pending approval detected. Use /tale approve or /tale reject' >&2; fi",
"comment": "Notify about pending approvals"
}
]
}
],
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE '(rm -rf /|mkfs|dd if=|:(){|fork|shutdown|reboot|halt)'; then echo '๐ทโ Blocked: Potentially destructive command detected' >&2; exit 2; fi",
"comment": "Block dangerous destructive commands"
}
],
"matcher": "Bash"
},
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qiE '(script|story|content)'; then echo '๐ทโ Reminder: Ensure content follows child-safety guidelines' >&2; fi",
"comment": "Remind about content safety for script files"
}
],
"matcher": "Write|Edit"
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "if [ -f .piggytales/state/workflow.json ]; then echo '๐ท๐ PiggyTales: Workflow state saved. Use /tale continue to resume.' >&2; fi",
"comment": "Save workflow state on session end"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "if [ -d .piggytales/logs ]; then echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Bash: $CLAUDE_TOOL_INPUT\" >> .piggytales/logs/commands.log; fi",
"comment": "Log command execution for workflow tracking"
}
],
"matcher": "Bash"
}
],
"SessionStart": [
{
"hooks": [
{
"type": "prompt",
"prompt": "๐ท๐ PiggyTales v1.0.0 - Where Piggy & Shroom tell amazing tales!\n\n**Quick Commands:**\n- /tale new audiobook \"Title\" - Create new audiobook\n- /tale quick test \"Title\" - Quick draft/test\n- /tale status - Check project status\n- /tale help - Show all commands\n\n**Presets:**\n- /tale preset audiobook-simple\n- /tale preset animation-full\n- /tale preset quick-test\n\n**Target Audiences:** children (4-12), teens (13-17), family, young-adult\n\nType any command or describe your content idea - let's create amazing tales together!"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_USER_INPUT\" | grep -qE '^/(tale|t) '; then echo '๐ท๐ PiggyTales command detected' >&2; fi",
"comment": "Detect /tale or /t commands"
},
{
"type": "command",
"command": "if echo \"$CLAUDE_USER_INPUT\" | grep -qiE '(audiobook|animation|story|tale|truyen|video)'; then echo '๐โจ Content creation detected - consider using /tale new or /tale quick' >&2; fi",
"comment": "Detect story/content keywords for quick suggestions"
}
]
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 1,
"command": 7
},
"eventStats": {
"Stop": 1,
"PreToolUse": 2,
"SessionEnd": 1,
"PostToolUse": 1,
"SessionStart": 1,
"UserPromptSubmit": 2
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 0,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 7
}
}