Stats
Actions
Tags
Governance hooks that gate Task, Bash, and Edit/Write/MultiEdit tool calls with token budgets, worktree checks, and preflight validation. Runs bash scripts on session start/stop and after Task delegation.
5 events · 14 hooks
Safety signals detected in this hook configuration
Where this hook configuration is defined
Defined in hooks/hooks.json
Event handlers and matchers — expand Raw Configuration for the full JSON
*#!/bin/bash
# Final check for console.logs in modified files
input=$(cat)
if git rev-parse --git-dir > /dev/null 2>&1; then
modified_files=$(git diff --name-only HEAD 2>/dev/null | grep -E '\.(ts|tsx|js|jsx)$' || true)
if [ -n "$modified_files" ]; then
has_console=false
while IFS= read -r file; do
if [ -f "$file" ]; then
if grep -q "console\.log" "$file" 2>/dev/null; then
echo "[Hook] WARNING: console.log found in $file" >&2
has_console=true
fi
fi
done <<< "$modified_files"
if [ "$has_console" = true ]; then
echo "[Hook] Remove console.log statements before committing" >&2
fi
fi
fi
echo "$input"*${CLAUDE_PLUGIN_ROOT}/hooks/memory-persistence/session-end.sh*${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning/evaluate-session.sh*${CLAUDE_PLUGIN_ROOT}/hooks/memory-persistence/pre-compact.shtool == "Bash" && tool_input.command matches "(npm run dev|pnpm( run)? dev|yarn dev|bun run dev)"#!/bin/bash
input=$(cat)
cmd=$(echo "$input" | jq -r '.tool_input.command // ""')
# Block dev servers that aren't run in tmux
echo '[Hook] BLOCKED: Dev server must run in tmux for log access' >&2
echo '[Hook] Use this command instead:' >&2
echo "[Hook] tmux new-session -d -s dev 'npm run dev'" >&2
echo '[Hook] Then: tmux attach -t dev' >&2
exit 1tool == "Bash" && tool_input.command matches "(npm (install|test)|pnpm (install|test)|yarn (install|test)|bun (install|test)|cargo build|make|docker|pytest|vitest|playwright)"#!/bin/bash
input=$(cat)
if [ -z "$TMUX" ]; then
echo '[Hook] Consider running in tmux for session persistence' >&2
echo '[Hook] tmux new -s dev | tmux attach -t dev' >&2
fi
echo "$input"tool == "Bash" && tool_input.command matches "git push"#!/bin/bash
# Open editor for review before pushing
echo '[Hook] Review changes before push...' >&2
# Uncomment your preferred editor:
# zed . 2>/dev/null
# code . 2>/dev/null
# cursor . 2>/dev/null
echo '[Hook] Press Enter to continue with push or Ctrl+C to abort...' >&2
read -rtool == "Write" && tool_input.file_path matches "\\.(md|txt)$" && !(tool_input.file_path matches "README\\.md|CLAUDE\\.md|AGENTS\\.md|CONTRIBUTING\\.md")#!/bin/bash
# Block creation of unnecessary documentation files
input=$(cat)
file_path=$(echo "$input" | jq -r '.tool_input.file_path // ""')
if [[ "$file_path" =~ \.(md|txt)$ ]] && [[ ! "$file_path" =~ (README|CLAUDE|AGENTS|CONTRIBUTING)\.md$ ]]; then
echo "[Hook] BLOCKED: Unnecessary documentation file creation" >&2
echo "[Hook] File: $file_path" >&2
echo "[Hook] Use README.md for documentation instead" >&2
exit 1
fi
echo "$input"tool == "Edit" || tool == "Write"${CLAUDE_PLUGIN_ROOT}/hooks/strategic-compact/suggest-compact.shtool == "Bash"#!/bin/bash
# Auto-detect PR creation and log useful info
input=$(cat)
cmd=$(echo "$input" | jq -r '.tool_input.command')
if echo "$cmd" | grep -qE 'gh pr create'; then
output=$(echo "$input" | jq -r '.tool_output.output // ""')
pr_url=$(echo "$output" | grep -oE 'https://github.com/[^/]+/[^/]+/pull/[0-9]+')
if [ -n "$pr_url" ]; then
echo "[Hook] PR created: $pr_url" >&2
echo "[Hook] Checking GitHub Actions status..." >&2
repo=$(echo "$pr_url" | sed -E 's|https://github.com/([^/]+/[^/]+)/pull/[0-9]+|\1|')
pr_num=$(echo "$pr_url" | sed -E 's|.*/pull/([0-9]+)|\1|')
echo "[Hook] To review PR: gh pr review $pr_num --repo $repo" >&2
fi
fi
echo "$input"tool == "Edit" && tool_input.file_path matches "\\.(ts|tsx|js|jsx)$"#!/bin/bash
# Auto-format with Prettier after editing JS/TS files
input=$(cat)
file_path=$(echo "$input" | jq -r '.tool_input.file_path // ""')
if [ -n "$file_path" ] && [ -f "$file_path" ]; then
if command -v prettier >/dev/null 2>&1; then
prettier --write "$file_path" 2>&1 | head -5 >&2
fi
fi
echo "$input"tool == "Edit" && tool_input.file_path matches "\\.(ts|tsx)$"#!/bin/bash
# Run TypeScript check after editing TS files
input=$(cat)
file_path=$(echo "$input" | jq -r '.tool_input.file_path // ""')
if [ -n "$file_path" ] && [ -f "$file_path" ]; then
dir=$(dirname "$file_path")
project_root="$dir"
while [ "$project_root" != "/" ] && [ ! -f "$project_root/package.json" ]; do
project_root=$(dirname "$project_root")
done
if [ -f "$project_root/tsconfig.json" ]; then
cd "$project_root" && npx tsc --noEmit --pretty false 2>&1 | grep "$file_path" | head -10 >&2 || true
fi
fi
echo "$input"tool == "Edit" && tool_input.file_path matches "\\.(ts|tsx|js|jsx)$"#!/bin/bash
# Warn about console.log in edited files
input=$(cat)
file_path=$(echo "$input" | jq -r '.tool_input.file_path // ""')
if [ -n "$file_path" ] && [ -f "$file_path" ]; then
console_logs=$(grep -n "console\\.log" "$file_path" 2>/dev/null || true)
if [ -n "$console_logs" ]; then
echo "[Hook] WARNING: console.log found in $file_path" >&2
echo "$console_logs" | head -5 >&2
echo "[Hook] Remove console.log before committing" >&2
fi
fi
echo "$input"*${CLAUDE_PLUGIN_ROOT}/hooks/memory-persistence/session-start.shnpx claudepluginhub skyconnfig/everything-claude-code-zh10plugins reuse this hooks config
First indexed Jan 10, 2026
Showing the 6 earliest of 10 plugins