npx claudepluginhub nguyenthienthanh/piggytalesDefined in hooks/hooks.json
if [ -f .piggytales/state/pending-approval.json ]; then echo '๐ทโ PiggyTales: Pending approval detected. Use /tale approve or /tale reject' >&2; fiBashif 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; fiWrite|Editif echo "$CLAUDE_TOOL_INPUT" | grep -qiE '(script|story|content)'; then echo '๐ทโ Reminder: Ensure content follows child-safety guidelines' >&2; fiif [ -f .piggytales/state/workflow.json ]; then echo '๐ท๐ PiggyTales: Workflow state saved. Use /tale continue to resume.' >&2; fiBashif [ -d .piggytales/logs ]; then echo "[$(date '+%Y-%m-%d %H:%M:%S')] Bash: $CLAUDE_TOOL_INPUT" >> .piggytales/logs/commands.log; fiif echo "$CLAUDE_USER_INPUT" | grep -qE '^/(tale|t) '; then echo '๐ท๐ PiggyTales command detected' >&2; fiif 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; fiPreToolUse hooks protect files on Edit/Write/MultiEdit and validate readonly Bash queries/vault-rm; captures session prompts/tools/memory; harvests usage data for distillation on end/stop. Uses bash/Python scripts, touches files.