GitHub Trending์ถœ์ฒ˜: GitHub Trending Weekly All์กฐํšŒ์ˆ˜ 15

disler/claude-code-hooks-mastery

By GitHub Trending Weekly All
2026๋…„ 2์›” 9์ผ
**disler/claude-code-hooks-mastery**

Master Claude Code HooksClaude Code Hooks Mastery 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, the powerful Meta-Agent, and Team-Based Validation with agent orchestration. Table of Contents Prerequisites Hook Lifecycle & Payloads What This Shows UV Single-File Scripts Architecture Key Files Features Demonstrated Hook Error Codes & Flow Control UserPromptSubmit Hook Deep Dive Claude Code Sub-Agents Team-Based Validation System Output Styles Collection Custom Status Lines Prerequisites This requires: Astral UV - Fast Python package installer and resolver Claude Code - Anthropic's CLI for Claude AI Optional Setup: Optional: ElevenLabs - Text-to-speech provider (with MCP server integration) ElevenLabs MCP Server - MCP server for ElevenLabs Firecrawl MCP Server - Web scraping and crawling MCP server (my favorite scraper) OpenAI - Language model provider + Text-to-speech provider Anthropic - Language model provider Ollama - Local language model provider Hook Lifecycle & Payloads This demo captures all 13 Claude Code hook lifecycle events with their JSON payloads: Hook Lifecycle Overview 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 commands (rm -rf, .env access) 3...

---

**[devsupporter ํ•ด์„ค]**

์ด ๊ธฐ์‚ฌ๋Š” GitHub Trending Weekly All์—์„œ ์ œ๊ณตํ•˜๋Š” ์ตœ์‹  ๊ฐœ๋ฐœ ๋™ํ–ฅ์ž…๋‹ˆ๋‹ค. ๊ด€๋ จ ๋„๊ตฌ๋‚˜ ๊ธฐ์ˆ ์— ๋Œ€ํ•ด ๋” ์•Œ์•„๋ณด์‹œ๋ ค๋ฉด ์›๋ณธ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.