cc-hooks

Solid

Configure Claude Code hooks for PreToolUse, PostToolUse, Stop, Notification. Use when blocking commands, auto-formatting, custom permissions, or writing hooks.

AI & Automation 389 stars 40 forks Updated today NOASSERTION

Install

View on GitHub

Quality Score: 86/100

Stars 20%
86
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Claude Code Hooks Shell commands that fire at specific points in Claude Code's lifecycle. <!-- TOC: Quick Start | Events | Blocking | Writing Hooks | Anti-Patterns | References --> ## Quick Start Add to `~/.claude/settings.json` (user) or `.claude/settings.json` (project): ```json { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "my-validator.sh" } ] } ] } } ``` ## Hook Events | Event | When | Blocks? | Common Use | |-------|------|---------|------------| | `PreToolUse` | Before tool runs | Yes | Block/modify commands | | `PostToolUse` | After tool succeeds | Feedback | Auto-format, lint | | `PermissionRequest` | Permission dialog | Yes | Auto-approve/deny | | `UserPromptSubmit` | Prompt submitted | Yes | Add context, validate | | `Stop` | Claude finishes | Yes | Force continue | | `SessionStart` | Session begins | No | Load context, set env | | `Notification` | Notifications | No | Desktop alerts | Full schemas: [HOOK-EVENTS.md](references/HOOK-EVENTS.md) ## Matchers ``` "Bash" → exact match "Edit|Write" → regex OR "mcp__.*__write" → MCP tools "*" or "" → all tools ``` Tools: `Bash`, `Read`, `Write`, `Edit`, `Glob`, `Grep`, `Task`, `WebFetch`, `WebSearch` ## Exit Codes | Code | Effect | |------|--------| | 0 | Success - JSON parsed from stdout | | 2 | **Block** - stderr fed to Claude | | Other | Non-blocking error | ## Blockin...

Details

Author
boshu2
Repository
boshu2/agentops
Created
7 months ago
Last Updated
today
Language
Go
License
NOASSERTION

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category