{"id":50619367,"url":"https://github.com/ithiria894/awesome-claude-code-hooks","last_synced_at":"2026-06-23T05:00:28.303Z","repository":{"id":346309026,"uuid":"1189327547","full_name":"ithiria894/awesome-claude-code-hooks","owner":"ithiria894","description":"Curated collection of Claude Code hooks for event-driven automation","archived":false,"fork":false,"pushed_at":"2026-03-23T16:13:20.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-24T05:24:35.394Z","etag":null,"topics":["automation","awesome","awesome-list","claude-code","event-driven","hooks"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ithiria894.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T07:55:13.000Z","updated_at":"2026-03-24T03:54:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ithiria894/awesome-claude-code-hooks","commit_stats":null,"previous_names":["ithiria894/awesome-claude-code-hooks"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ithiria894/awesome-claude-code-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ithiria894%2Fawesome-claude-code-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ithiria894%2Fawesome-claude-code-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ithiria894%2Fawesome-claude-code-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ithiria894%2Fawesome-claude-code-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ithiria894","download_url":"https://codeload.github.com/ithiria894/awesome-claude-code-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ithiria894%2Fawesome-claude-code-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34675970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","awesome","awesome-list","claude-code","event-driven","hooks"],"created_at":"2026-06-06T10:00:20.063Z","updated_at":"2026-06-23T05:00:28.293Z","avatar_url":"https://github.com/ithiria894.png","language":null,"funding_links":[],"categories":["Related Awesome Lists"],"sub_categories":[],"readme":"# Awesome Claude Code Hooks [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)\n\n\u003e Curated collection of Claude Code hooks — event-driven automations that trigger before or after Claude Code actions.\n\nHooks are shell commands that run automatically when Claude Code performs specific actions. They're defined in `settings.json` and trigger on events like `PreToolUse`, `PostToolUse`, `Notification`, `Stop`, and more.\n\nLooking for complete workflow recipes? See [awesome-claude-code-workflows](https://github.com/ithiria894/awesome-claude-code-workflows). Looking for tools and skills? See [awesome-claude-code](https://github.com/hesreallyhim/awesome-claude-code).\n\n## Contents\n\n- [Security and Prompt Injection](#security-and-prompt-injection)\n- [Safety and Protection](#safety-and-protection)\n- [Monitoring and Observability](#monitoring-and-observability)\n- [Code Quality Gates](#code-quality-gates)\n- [Context and Memory](#context-and-memory)\n- [Model Routing and Cost](#model-routing-and-cost)\n- [Session Management](#session-management)\n- [File Organization](#file-organization)\n- [Notification and Alerts](#notification-and-alerts)\n- [Voice and Sound](#voice-and-sound)\n- [Git Integration](#git-integration)\n- [Hook SDKs and Frameworks](#hook-sdks-and-frameworks)\n- [Hook Collections](#hook-collections)\n- [Creative and Utility](#creative-and-utility)\n- [Learning Resources](#learning-resources)\n\n---\n\n## Security and Prompt Injection\n\nHooks that detect and block prompt injection attacks in tool outputs.\n\n- [Lasso Claude-Hooks](https://github.com/lasso-security/claude-hooks) - Scans tool outputs for 50+ prompt injection patterns including instruction overrides, role-playing jailbreaks, encoded payloads, and data exfiltration commands. Injects warnings into Claude's context. Triggers on: `PostToolUse`.\n- [dwarvesf/claude-guardrails](https://github.com/dwarvesf/claude-guardrails) - Hardened security config with deny rules, destructive command blocking, pipe-to-shell blocking, data exfiltration prevention, and prompt injection scanning. Lite (3 hooks) and Full (5 hooks + scanner) modes. Install via `npx claude-guardrails install`. Triggers on: `PreToolUse`, `PostToolUse`.\n- [CloneGuard](https://github.com/prodnull/cloneguard) - 4-layer defense: pre-execution repo scan, InstructionsLoaded hook, PostToolUse output scanning, PreToolUse write/build gating. Uses ONNX embedding classifier (non-promptable) instead of LLM for detection. Works with Claude Code, Gemini CLI, Cursor. Triggers on: `PreToolUse`, `PostToolUse`, `InstructionsLoaded`.\n- [claude-injection-guard](https://github.com/michaelhannecke/claude-injection-guard) - Two-stage prompt injection guard: Stage 1 is regex (zero deps, sub-ms), Stage 2 escalates to local LLM (Ollama/LM Studio). Zero data leaves your machine. Triggers on: `PostToolUse` (WebFetch).\n- [rulebricks/claude-code-guardrails](https://github.com/rulebricks/claude-code-guardrails) - Real-time guardrails for Claude Code tool calls. 61 stars. Triggers on: `PreToolUse`, `PostToolUse`.\n- [panuhorsmalahti/claude-code-permissions-hook](https://github.com/panuhorsmalahti/claude-code-permissions-hook) - Rust-based granular permission controls via TOML config. Allow/deny rules with regex pattern matching, exclude patterns for edge cases, and JSON audit logging. Workaround for current Claude Code permission limitations. Triggers on: `PreToolUse`.\n- [liberzon/claude-hooks](https://github.com/liberzon/claude-hooks) - Smart PreToolUse hook that decomposes compound bash commands (`\u0026\u0026`, `||`, `;`, `|`, `$()`, newlines) into individual sub-commands and checks each against your allow/deny patterns. Loads permissions from all settings layers (global + project + local). Triggers on: `PreToolUse` (Bash).\n\n## Safety and Protection\n\nHooks that prevent Claude Code from making unwanted changes.\n\n- [wangbooth/Claude-Code-Guardrails](https://github.com/wangbooth/Claude-Code-Guardrails) - Protective hooks that prevent accidental code loss through branch protection, automatic checkpointing, and safe commit squashing. 51 stars. Triggers on: `PreToolUse`, `PostToolUse`.\n- [gstack freeze/guard](https://github.com/garrytan/gstack) - Lock critical files from modification. Uses `PreToolUse` hook definitions in SKILL.md frontmatter (not hooks.json) with real shell scripts (`freeze/bin/check-freeze.sh`). Note: only enforced in Claude Code — generated Codex skill docs are advisory prose only. Found in `freeze/SKILL.md.tmpl` and `guard/SKILL.md.tmpl`. Triggers on: `PreToolUse` (Write/Edit).\n- [Everything Claude Code hook profiles](https://github.com/affaan-m/everything-claude-code) - 26 hook entries across 7 event groups with 27 hook scripts. Three preset safety levels: minimal, standard, strict. Codex-verified counts: 116 skills, 28 agents, 59 commands. Triggers on: `PreToolUse`, `PostToolUse`, and 5 other event types.\n- [Pre-commit hook guard](https://github.com/anthropics/claude-code/tree/main/hooks) - Official example: block commits that skip pre-commit hooks (prevents `--no-verify`). Triggers on: `PreToolUse` (Bash).\n\n## Monitoring and Observability\n\nHooks that track and visualize Claude Code activity in real-time.\n\n- [Multi-Agent Observability Dashboard](https://github.com/disler/claude-code-hooks-multi-agent-observability) - Real-time monitoring dashboard for Claude Code agents through hook event tracking. Streams tool usage events to a web UI. 1,289 stars. Triggers on: all hook events.\n- [MadameClaude](https://github.com/williamkapke/MadameClaude) - Monitoring system that captures and streams tool usage events to a web interface in real-time. 21 stars. Triggers on: `PreToolUse`, `PostToolUse`.\n- [ccproxy](https://github.com/starbaser/ccproxy) - Proxy that hooks into Claude Code requests for intelligent model routing, request/response modification, and LangFuse tracking. 189 stars. Triggers on: request-level proxy hooks.\n\n## Code Quality Gates\n\nHooks that enforce code quality standards automatically.\n\n- [Auto-lint on save](https://github.com/affaan-m/everything-claude-code) - Run linter after every file write. Reject changes that introduce lint errors. Found in `hooks/hooks.json`. Triggers on: `PostToolUse` (Write/Edit).\n- [Claude Organize](https://github.com/ramakay/claude-organizer) - AI-powered file organization hook that automatically sorts temporary scripts from permanent docs. Understands content, not just patterns. 61 stars. Triggers on: `PostToolUse` (Write/Edit).\n\n## Context and Memory\n\nHooks that manage what Claude knows across sessions and compactions.\n\n- [post_compact_reminder](https://github.com/Dicklesworthstone/post_compact_reminder) - Detects context compaction and injects a reminder to re-read AGENTS.md, preventing post-compaction rule amnesia in long sessions. 34 stars. Triggers on: `PostCompact`.\n- [Continuous Claude v3](https://github.com/parcadei/Continuous-Claude-v3) - Context management via hooks that maintain state through ledgers and handoffs. MCP execution without context pollution. Agent orchestration with isolated context windows. 3,619 stars. Triggers on: multiple lifecycle hooks.\n- [Memory injection hook](https://github.com/affaan-m/everything-claude-code) - Inject alerts, briefings, and relevant memories before each message. Scans memory files and surfaces the most relevant context. Found in `hooks/hooks.json`. Triggers on: pre-message.\n- [Founder OS institutional memory](https://github.com/cloudrepo-io/founder-os) - Accumulates learnings from task completions into `.claude/learnings/`. Future sessions automatically reference past lessons. Triggers on: task completion.\n\n## Model Routing and Cost\n\nHooks that optimize model selection and track spending.\n\n- [claude-model-router-hook](https://github.com/tzachbon/claude-model-router-hook) - Auto-switches model tier based on task complexity (e.g., Haiku for simple reads, Opus for complex reasoning). 25 stars. Triggers on: `PreToolUse`.\n- [Cost tracker hook](https://github.com/karanb192/claude-code-hooks) - Tracks token usage and estimated cost per session. Part of a 10-hook collection. Triggers on: `PostToolUse`.\n\n## Session Management\n\nHooks that manage Claude Code session state.\n\n- [Everything Claude Code session persistence](https://github.com/affaan-m/everything-claude-code) - Save and restore session context across restarts. Auto-dumps important state on session end, reloads on next start. Triggers on: `Stop`, session start.\n- [Superpowers session-start](https://github.com/obra/superpowers) - Auto-load project context and active tasks when starting a new session. Found in `hooks/hooks.json`. Triggers on: session start.\n\n## File Organization\n\nHooks that keep your project directory clean.\n\n- [Claude Organize](https://github.com/ramakay/claude-organizer) - Automatically moves files Claude creates in the wrong place. Scripts go to `scripts/`, docs go to `docs/`, test results go to `docs/testing/`. 10 script subcategories. 61 stars. Triggers on: `PostToolUse` (Write).\n\n## Notification and Alerts\n\nHooks that notify you about Claude Code activity.\n\n- [claude-code-toast](https://github.com/eyalzh/claude-code-toast) - macOS toast notification when Claude Code is waiting for user response. 16 stars. Triggers on: `Notification`.\n- [aily](https://github.com/jiunbae/aily) - Discord notifications with per-tmux-session threads. Each Claude session gets its own Discord thread. 6 stars. Triggers on: `Notification`, `Stop`.\n- [Desktop notification on complete](https://github.com/anthropics/claude-code/tree/main/hooks) - Official example: send system notification when a long-running task completes. Triggers on: `Stop`.\n- [Solopreneur decision logger](https://github.com/pcatattacks/solopreneur-plugin) - Auto-logs every user decision with reasoning when Claude asks a question. Creates an observer protocol for future reference. Triggers on: `PostToolUse` (AskUserQuestion).\n\n## Voice and Sound\n\nHooks that add audio feedback to Claude Code events.\n\n- [Voice output hooks](https://github.com/shanraisshan/claude-code-hooks) - Adds text-to-speech voice output to Claude Code responses and notifications. 187 stars. Triggers on: `Notification`, `Stop`.\n- [SCV Sounds](https://github.com/htjun/claude-code-hooks-scv-sounds) - StarCraft SCV sound effects for hook events (tool use, completion, errors). 38 stars. Triggers on: `PreToolUse`, `PostToolUse`, `Stop`, `Notification`.\n\n## Git Integration\n\nHooks that connect Claude Code actions to git operations.\n\n- [GitButler Claude Code hooks](https://docs.gitbutler.com/features/ai-integration/claude-code-hooks) - Official GitButler integration: PreToolUse creates session-specific git index, PostToolUse stages files, Stop commits to per-session branch under `refs/heads/claude/`. Enables parallel sessions with isolated branches. By Scott Chacon. Triggers on: `PreToolUse`, `PostToolUse`, `Stop`.\n- [Auto-checkpoint on skill completion](https://github.com/pcatattacks/solopreneur-plugin) - Automatically creates a git commit after every skill finishes running. Ensures you can always roll back. Triggers on: skill completion.\n- [Branch-per-task pattern](https://github.com/cloudrepo-io/founder-os) - Auto-create a new branch when starting a task from the queue. Isolates work for clean PR creation. Triggers on: task start.\n\n## Hook SDKs and Frameworks\n\nTools for building and managing hooks in different languages.\n\n- [cchooks (Python)](https://github.com/GowayLee/cchooks) - Python SDK for building Claude Code hooks. Abstracts stdin/stdout JSON handling, exit codes, and event matching. 123 stars.\n- [cc-hooks-ts (TypeScript)](https://github.com/sushichan044/cc-hooks-ts) - TypeScript SDK with full type safety for defining hooks. 35 stars.\n- [claude-hooks-sdk (PHP)](https://github.com/beyondcode/claude-hooks-sdk) - PHP SDK for building Claude Code hooks. 62 stars.\n- [claude_hooks (Ruby)](https://github.com/gabriel-dehan/claude_hooks) - Ruby DSL for creating Claude Code hooks. 36 stars.\n- [claude-hooks CLI manager](https://github.com/webdevtodayjason/claude-hooks) - CLI manager for hooks — add, remove, list, toggle hooks without editing JSON. 73 stars.\n- [Hookify plugin](https://paddo.dev/blog/claude-code-hooks-guardrails/) - Zero-JSON hook creation via natural language. `/hookify Block rm -rf commands` creates the hook without editing settings.json.\n\n## Hook Collections\n\nRepos that bundle multiple hooks together.\n\n- [karanb192/claude-code-hooks](https://github.com/karanb192/claude-code-hooks) - 10-hook collection: cost-tracker, rate-limiter, branch-guard, protect-tests, context-snapshot, ntfy-notify, discord-notify, tts-alerts, rules-injector, session-summary. Copy-paste ready. 298 stars.\n- [Aedelon/claude-code-blueprint](https://github.com/Aedelon/claude-code-blueprint) - 11 hooks covering 9 of 17 lifecycle events: session-start, session-end, user-prompt-secrets, bash-guard, write-format, bash-vuln (npm audit), posttooluse-failure logging, stop (git summary), pre-compact (context preservation), and permission-git warnings. All scripts start with `set -euo pipefail` + `trap ERR` for fail-closed behavior.\n- [decider/claude-hooks](https://github.com/decider/claude-hooks) - Comprehensive hooks for enforcing clean code practices and automating workflows. Covers formatting, linting, and code quality gates.\n- [JalelTounsi/claude-code-skills](https://github.com/JalelTounsi/claude-code-skills) - 30 hooks including 6 mandatory security hooks: pre-commit secret scanning (25+ patterns), destructive command blocking (`rm -rf /`, `DROP DATABASE`, `chmod 777`), and progressive adoption tiers. Part of a 138-skill collection.\n\n## Creative and Utility\n\nUnique and experimental hooks.\n\n- [cc-dice](https://github.com/pro-vi/cc-dice) - Probabilistic dice triggers — adds randomness to hook execution (e.g., only run expensive checks 20% of the time). Wraps any hook event. 21 stars.\n\n## Learning Resources\n\nGuides and tutorials for writing hooks.\n\n- [Claude Code Hooks Mastery](https://github.com/disler/claude-code-hooks-mastery) - Complete reference implementation of all 13 hook lifecycle events with JSON payloads captured. Includes TTS, Ruff linting, transcript extraction, sub-agent hooks, and team-based validation. 3,379 stars.\n- [95-hook production infrastructure](https://blakecrosley.com/blog/claude-code-hooks) - Blog documenting 95 production hooks across 4 layers: Prevention (PreToolUse), Context (UserPromptSubmit), Validation (PostToolUse), Quality (Stop). Includes recursion-guard, circuit-breaker, and pride-check.\n- [Claude Code official hooks docs](https://docs.anthropic.com/en/docs/claude-code/hooks) - Official documentation covering all hook events, configuration, and best practices.\n- [gstack hooks patterns](https://github.com/garrytan/gstack) - Production hooks for file protection (freeze/guard) used by a YC partner.\n- [Claude Directory hooks guide](https://www.claudedirectory.org/blog/claude-code-hooks-guide) - Complete guide with layered pipeline config combining prevention (PreToolUse), enforcement (PostToolUse), and notification (Stop) hooks into a production-ready setup.\n- [Blake Crosley hooks tutorial](https://blakecrosley.com/blog/claude-code-hooks-tutorial) - Step-by-step tutorial building 5 production hooks from scratch: auto-formatter, security gate, test runner, notification alert, and pre-commit quality check. By the author of the 95-hook production infrastructure.\n- [12 Automation Configs (heyuan110)](https://www.heyuan110.com/posts/ai/2026-02-28-claude-code-hooks-guide/) - 12 copy-paste-ready hook configs covering all 15 lifecycle events. Includes Prettier auto-format, file protection, command blocking, and team-sharing patterns.\n- [Serenities AI hooks guide](https://serenitiesai.com/articles/claude-code-hooks-guide-2026) - Covers all 18 hook events including newer ones (ConfigChange, WorktreeCreate, WorktreeRemove). Introduces HTTP hook type for remote webhook integration.\n- [Agent Rules Builder — 10 hook scripts](https://agentrulegen.com/guides/claude-code-hooks-setup) - 10 production-ready hook scripts with full shell code, JSON config, and testing instructions. Covers auto-format, destructive command blocking, file protection, git context loading, and post-compact recovery.\n\n---\n\n## Related Awesome Lists\n\n- [awesome-claude-code-workflows](https://github.com/ithiria894/awesome-claude-code-workflows) - Workflow recipes that combine hooks with skills, MCP servers, and agents.\n- [awesome-claude-code](https://github.com/hesreallyhim/awesome-claude-code) - Comprehensive catalog of Claude Code tools, skills, hooks, agents, and plugins.\n- [awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers) - The definitive list of MCP servers.\n- [awesome-claude-skills](https://github.com/ComposioHQ/awesome-claude-skills) - Claude Code skills collection.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. We curate, not collect — not every submission will be accepted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fithiria894%2Fawesome-claude-code-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fithiria894%2Fawesome-claude-code-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fithiria894%2Fawesome-claude-code-hooks/lists"}