Claude Code hook
claude-hooks
Set of hooks that enforce clean-code practices and automate routine checks during Claude Code sessions.
Install
git clone https://github.com/decider/claude-hooks.gitFrom the README
Claude Code Hooks A lightweight Python-based hook system for Claude Code that provides automatic validation and quality checks. Overview Claude Code Hooks allows you to set up automatic validation, quality checks, and notifications that run during your Claude Code sessions. The system uses Python scripts that integrate seamlessly with Claude's hook events. Features - 🐍 Python-based - Simple, portable hook implementation - ✅ Code Quality Validation - Enforces clean code standards - 📦 Package Age Checking - Prevents installation of outdated packages - 🔔 Task Completion Notifications - Get notified when Claude finishes tasks - 🎯 Easy Installation - One command setup - 🏗️ Hierarchical Configuration - Different rules for different directories - 🔍 Hook Introspection - See which hooks apply to any file Installation This will: 1. Create a .claude/ directory in your project 2. Copy all hook scripts to .claude/hooks/ 3. Generate .claude/settings.json with hook configurations 4. Add .claude/settings.local.json to your .gitignore How It Works The hook system uses three main entry points that Claude Code calls: - PreToolUse - Runs before tools like Bash, Write, or Edit are executed - PostToolUse - Runs after tools complete - Stop - Runs when Claude stops or completes a task Each hook receives event data via stdin and can: - Provide suggestions and warnings - Block operations that violate policies - Send notifications - Log activities Available Hooks Code Quality Validator Enforces clean code standards on file edits: - Maximum function length (30 lines) - Maximum file length (200 lines) - Maximum line length (100 characters) - Maximum nesting depth (4 levels) Package Age Checker Prevents installation of outdated npm/yarn packages: - Blocks packages older than 180…
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- decider/claude-hooks
- Type
- Hooks
- Language
- Python
- License
- MIT
- Last updated
- 20 July 2025
- Listed in
- awesome-claude-code-hooks
FAQ
What is claude-hooks?
Set of hooks that enforce clean-code practices and automate routine checks during Claude Code sessions. It is a hook for Claude Code, from decider/claude-hooks on GitHub.
How do I install claude-hooks?
Clone decider/claude-hooks from GitHub and follow the setup steps in its README.
Is claude-hooks popular?
decider/claude-hooks has 75 GitHub stars and 3 forks, and is included in 1 curated Claude Code list. It was last updated on 20 July 2025.
More hooks
Next16 Claude Starter
145textura-agency/next16-claude-starter
AI-first Next.js 16 starter for animation-heavy sites, wired with an Obsidian vault & Claude Code hooks
Interlinked CLI
183QuentinCody/interlinked-cli
The harness for your harness. Local hooks, taste enforcement, and developer observability for AI coding agents (Claude Code, Codex, Cursor, Copilot CLI).
PRD Driven Context Engineering
181mattgierhart/PRD-driven-context-engineering
PRD-Led Context Engineering — Memory as Infrastructure. An ontology layer for product teams building products that solve real problems — with AI agents that remember. Gated PRD, typed IDs, markdown knowledge graph, Claude Code skills & hooks.
Clawd Conduit
174ssssssanjiu/clawd-conduit
Full-lifecycle wiring between Claude Code and the Clawd on Desk pet — all 15 hook events, with permission prompts answered straight from the desktop
Claude Hooks Manager
74webdevtodayjason/claude-hooks
CLI for listing, adding and managing hooks in Claude Code settings.
Flonat Research
149flonat/flonat-research
Shareable Claude Code + Codex infrastructure for PhD researchers — skills, agents, hooks, and rules for academic workflows
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.