Claude
code.claude.com › docs › en › hooks-guide
Get started with Claude Code hooks - Claude Code Docs
Claude Code hooks are user-defined ... deterministic control over Claude Code’s behavior, ensuring certain actions always happen rather than relying on the LLM to choose to run them. For reference documentation on hooks, see Hooks reference. Example use cases for hooks incl...
Claude
docs.claude.com › en › docs › claude-code › hooks
Hooks reference - Claude Docs
Recognizes the same matcher values as PreToolUse. Runs when Claude Code sends notifications. Notifications are sent when: Claude needs your permission to use a tool. Example: “Claude needs your permission to use Bash”
Videos
01:34:18
New "Hooks" feature in Claude Code: Live Coding with Cursor - YouTube
r/ClaudeAI on Reddit: Claude Code Hooks Tutorial: PostToolUse Hook ...
08:11
Claude Code Hooks: MUST KNOW to Keep Claude Agent in Control! - ...
11:53
Claude Code - Getting Started with Hooks - YouTube
02:44
How Claude Code Hooks Save Me HOURS Daily - YouTube
34:16
How I Start EVERY Claude Code Project - YouTube
GitHub
github.com › disler › claude-code-hooks-mastery
GitHub - disler/claude-code-hooks-mastery
Chat transcript extraction - PostToolUse hook converts JSONL transcripts to readable JSON format · Warning: The chat.json file contains only the most recent Claude Code conversation. It does not preserve conversations from previous sessions - each new conversation is fully copied and overwrites the previous one.
Starred by 2K users
Forked by 431 users
Languages Python
GitButler Docs
docs.gitbutler.com › features › ai-integration › claude-code-hooks
Claude Code Hooks | GitButler Docs
Hooks in Claude Code are defined in one of your settings files. ~/.claude/settings.json - User settings .claude/settings.json - Project settings .claude/settings.local.json - Local project settings (not committed) Wherever you want to add GitButler to handle your commits automatically, you can add us as a hook by adding the following to the hooks array in whatever settings file you want to use: { "hooks": { "PreToolUse": [ { "matcher": "Edit|MultiEdit|Write", "hooks": [ { "type": "command", "command": "but claude pre-tool" } ] } ], "PostToolUse": [ { "matcher": "Edit|MultiEdit|Write", "hooks": [ { "type": "command", "command": "but claude post-tool" } ] } ], "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "but claude stop" } ] } ] } }
HexDocs
hexdocs.pm › claude_agent_sdk › hooks_guide.html
Claude Code Hooks Guide — claude_agent_sdk v0.6.8
Claude Code Hooks Reference · Design Document: docs/design/hooks_implementation.md (available in source repository) Examples: See examples/hooks/ directory in the source repository · Test Suite: See test/claude_agent_sdk/hooks/ directory in the source repository ·
GitHub
github.com › hesreallyhim › awesome-claude-code
GitHub - hesreallyhim/awesome-claude-code: A curated list of awesome commands, files, and workflows for Claude Code
Numerous specialized agents, slash-commands, and strong documentation. All parts of Claude Code's system prompt, including builtin tool descriptions, sub agent prompts (Plan/Explore/Task), utility prompts (CLAUDE.md, compact, Bash cmd, security review, agent creation, etc.). Updated for each Claude Code version. Professional development environment for Claude Code with spec-driven workflow, TDD enforcement, cross-session memory, semantic search, quality hooks, and modular rules integration.
Starred by 18.5K users
Forked by 1.1K users
Languages Python 98.9% | Makefile 1.1%
GitHub
github.com › disler › claude-code-hooks-multi-agent-observability
GitHub - disler/claude-code-hooks-multi-agent-observability: Real-time monitoring for Claude Code agents through simple hook event tracking.
If your hook scripts aren't executing properly, it might be due to relative paths in your .claude/settings.json. Claude Code documentation recommends using absolute paths for command scripts.
Starred by 858 users
Forked by 267 users
Languages Python 36.4% | Vue 30.4% | TypeScript 26.4% | CSS 4.2% | Shell 1.6% | JavaScript 0.9% | HTML 0.1%
Suite Insider
suiteinsider.com › home › complete guide: creating claude code hooks
Complete Guide: Creating Claude Code Hooks - Suite Insider
October 7, 2025 - Add this content to .claude/hooks/log-implementation.py: #!/usr/bin/env python3 """ Claude Code Implementation Logger Hook Logs every tool execution to a JSONL file """ import json import sys import os from datetime import datetime from pathlib import Path # Get project directory from Claude Code environment variable PROJECT_DIR = os.environ.get('CLAUDE_PROJECT_DIR', os.getcwd()) # Configure where logs are stored LOG_DIR = Path(PROJECT_DIR) / '.claude' / 'logs' LOG_FILE = LOG_DIR / 'implementation-steps.jsonl' def ensure_log_dir(): """Create log directory if it doesn't exist""" LOG_DIR.mkdir(p
DEV Community
dev.to › holasoymalva › the-ultimate-claude-code-guide-every-hidden-trick-hack-and-power-feature-you-need-to-know-2l45
The Ultimate Claude Code Guide: Every Hidden Trick, Hack, and Power Feature You Need to Know - DEV Community
September 12, 2025 - # Code quality check claude -p "Review the latest commit for potential issues" # Automated documentation claude -p "Generate API documentation for all endpoint files" ... # GitHub Actions workflow name: Claude Code Review on: [pull_request] jobs: review: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Claude Code Review run: | claude -p "Review this PR for security vulnerabilities and performance issues" \ --output-format json > review-results.json ... #!/bin/bash # .git/hooks/pre-commit changed_files=$(git diff --cached --name-only --diff-filter=ACM) if [ -n "$changed_files" ]; then claude -p "Review these changed files for issues: $changed_files" \ --output-format stream-json fi
GitHub
github.com › johnlindquist › claude-hooks
GitHub - johnlindquist/claude-hooks
The real power comes from editing .claude/hooks/index.ts. You get full TypeScript support with typed payloads: // Example: Track and log specific tool usage async function preToolUse(payload: PreToolUsePayload): Promise<HookResponse> { // Full type safety - TypeScript knows exactly what's in the payload!
Starred by 242 users
Forked by 9 users
Languages TypeScript 97.0% | sed 2.1%
Eesel AI
eesel.ai › blog › hooks-in-claude-code
A complete guide to hooks in Claude Code: Automating your development workflow - eesel AI
Explore our complete guide to hooks in Claude Code. Learn what they are, how they work, and their limitations for true business workflow automation.