Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Master Claude Code Hooks
| Date | Stars |
|---|---|
| 2026-07-31 | 3862 |
| 2026-08-03 | 3862 |
| 2026-08-04 | 3868 |
| 2026-08-06 | 3868 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Claude Code Hooks Mastery
[Claude Code Hooks](https://docs.anthropic.com/en/docs/claude-code/hooks) - Quickly master how to use Claude Code hooks to add deterministic (or non-deterministic) control over Claude Code's behavior. Plus learn about [Claude Code Sub-Agents](#claude-code-sub-agents), the powerful [Meta-Agent](#the-meta-agent), and [Team-Based Validation](#team-based-validation-system) with agent orchestration.
<img src="images/hooked.png" alt="Claude Code Hooks" style="max-width: 800px; width: 100%;" />
## Table of Contents
- [Prerequisites](#prerequisites)
- [Hook Lifecycle & Payloads](#hook-lifecycle--payloads)
- [What This Shows](#what-this-shows)
- [UV Single-File Scripts Architecture](#uv-single-file-scripts-architecture)
- [Key Files](#key-files)
- [Features Demonstrated](#features-demonstrated)
- [Hook Error Codes & Flow Control](#hook-error-codes--flow-control)
- [UserPromptSubmit Hook Deep Dive](#userpromptsubmit-hook-deep-dive)
- [Claude Code Sub-Agents](#claude-code-sub-agents)
- [Team-Based Validation System](#team-based-validation-system)
- [Output Styles Collection](#output-styles-collection)
- [Custom Status Lines](#custom-status-lines)
## Prerequisites
This requires:
- **[Astral UV](https://docs.astral.sh/uv/getting-started/installation/)** - Fast Python package installer and resolver
- **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** - Anthropic's CLI for Claude AI
### Optional Setup:
Optional:
- **[ElevenLabs](https://elevenlabs.io/)** - Text-to-speech provider (with MCP server integration)
- **[ElevenLabs MCP Server](https://github.com/elevenlabs/elevenlabs-mcp)** - MCP server for ElevenLabs
- **[Firecrawl MCP Server](https://www.firecrawl.dev/mcp)** - Web scraping and crawling MCP server (my favorite scraper)
- **[OpenAI](https://openai.com/)** - Language model provider + Text-to-speech provider
- **[Anthropic](https://www.anthropic.com/)** - Language model provider
- **[Ollama](https://ollama.com/)** - Local language model provider
## Hook Lifecycle & Payloads
This demo captures all 13 Claude Code hook lifecycle events with their JSON payloads:
### Hook Lifecycle Overview
```mermaid
flowchart TB
subgraph SESSION["🟢 Session Lifecycle"]
direction TB
SETUP[["🔧 Setup<br/>(init/maintenance)"]]
START[["▶️ SessionStart<br/>(startup/resume/clear)"]]
END[["⏹️ SessionEnd<br/>(exit/sigint/error)"]]
end
subgraph MAIN["🔄 Main Conversation Loop"]
direction TB
PROMPT[["📝 UserPromptSubmit"]]
CLAUDE["Claude Processes"]
subgraph TOOLS["🛠️ Tool Execution"]
direction TB
PRE[["🔒 PreToolUse"]]
PERM[["❓ PermissionRequest"]]
EXEC["Tool Executes"]
POST[["✅ PostToolUse"]]
FAIL[["❌ PostToolUseFailure"]]
end
subgraph SUBAGENT["🤖 Subagent Lifecycle"]
direction TB
SSTART[["🚀 SubagentStart"]]
SWORK["Subagent Works"]
SSTOP[["🏁 SubagentStop"]]
end
NOTIFY[["🔔 Notification<br/>(Async)"]]
STOP[["🛑 Stop"]]
end
subgraph COMPACT["🗜️ Maintenance"]
PRECOMPACT[["📦 PreCompact"]]
end
SETUP --> START
START --> PROMPT
PROMPT --> CLAUDE
CLAUDE --> PRE
PRE --> PERM
PERM --> EXEC
EXEC --> POST
EXEC -.-> FAIL
CLAUDE -.-> SSTART
SSTART --> SWORK
SWORK --> SSTOP
POST --> CLAUDE
CLAUDE --> STOP
CLAUDE -.-> NOTIFY
STOP --> PROMPT
STOP -.-> END
PROMPT -.-> PRECOMPACT
PRECOMPACT -.-> PROMPT
```
### 1. UserPromptSubmit Hook
**Fires:** Immediately when user submits a prompt (before Claude processes it)
**Payload:** `prompt` text, `session_id`, timestamp
**Enhanced:** Prompt validation, logging, context injection, security filtering
### 2. PreToolUse Hook
**Fires:** Before any tool execution
**Payload:** `tool_name`, `tool_input` parameters
**Enhanced:** Blocks dangerous coExcerpt of 41,208 characters
Read on GitHubIndyDevDan
10
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:65ef94c9c80055df, llm:Repository name and description: 'Master Claude Code Hooks' — suggests collection/examples for Claude (Anthropic) code hooks integration; language Python. Likely relates to prompt-engineering or agents/plugins/hooks for AI model integration.
matched fp:65ef94c9c80055df, llm:Repository name and description: 'Master Claude Code Hooks' — suggests collection/examples for Claude (Anthropic) code hooks integration; language Python. Likely relates to prompt-engineering or agents/plugins/hooks for AI model integration.
matched fp:65ef94c9c80055df, llm:Repository name and description: 'Master Claude Code Hooks' — suggests collection/examples for Claude (Anthropic) code hooks integration; language Python. Likely relates to prompt-engineering or agents/plugins/hooks for AI model integration.