Claude Code Hooks banner
karanb192

Claude Code Hooks

Development

Description

🪝 A growing collection of useful Claude Code hooks. Copy, paste, customize.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

claude-code-hooks

🪝 Ready-to-use hooks for Claude Code — safety, automation, notifications, and more.

[![GitHub stars](https://img.shields.io/github/stars/karanb192/claude-code-hooks?style=social)](https://github.com/karanb192/claude-code-hooks) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Tests](https://img.shields.io/badge/tests-262%20passing-brightgreen)](hook-scripts/tests)

🎬 Quick Demo

Protecting Secrets Blocking Dangerous Commands
Hook blocking .env read Hook blocking dangerous commands

A growing collection of tested, documented hooks you can copy, paste, and customize.


📑 Table of Contents


🪝 Hooks

Pre-Tool-Use

Runs **before** Claude executes a tool. Can block or modify the operation.

Hook Matcher Description
block-dangerous-commands Bash Blocks dangerous shell commands (rm -rf ~, fork bombs, curl|sh)
protect-secrets Read|Edit|Write|Bash Prevents reading/modifying/exfiltrating sensitive files

Post-Tool-Use

Runs **after** Claude executes a tool. Can react to results.

Hook Matcher Description
auto-stage Edit|Write Automatically git stages files after Claude modifies them

Notification

Fires when Claude needs user attention.

| Hook | Matcher