10-hooks

Create Claude Code hooks that guard and monitor tool execution workflows.

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/rhpds/claude-code-courseware --skill 10-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 10-hooks
Source: https://github.com/rhpds/claude-code-courseware/tree/main/lola/ccc/skills/10-hooks
Command: npx skills add https://github.com/rhpds/claude-code-courseware --skill 10-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers control and automate Claude Code tool execution by creating hooks that prevent risky actions, add visibility, and enforce workflow rules without changing Claude's behavior directly.

Core Features & Use Cases

  • PreToolUse Guardrails: Create hooks that inspect commands before execution and block destructive operations such as unsafe Git actions.
  • PostToolUse Automation: Build hooks that react after tool execution to log changes, trigger workflows, or maintain audit trails.
  • Use Case: A development team can use this Skill to add project-level safety checks that prevent accidental force pushes while recording file edits made during AI-assisted coding sessions.

Quick Start

Use the hooks skill to create a Claude Code pre-tool guardrail that blocks destructive Git commands.

Frequently Asked Questions about 10-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add guardrails to Claude Code to block unsafe Git commands?

You can add Claude Code guardrails by configuring PreToolUse hooks that inspect commands before execution and block destructive Git operations like force pushes. This prevents risky actions without altering Claude's core behavior directly.

What are Claude Code hooks and how do they automate tool execution workflows?

Claude Code hooks are automated scripts that control and monitor tool execution workflows by matching specific tools, handling JSON input, and running validation checks. They enforce workflow rules and add visibility to AI-assisted coding sessions.

Can I create an audit log for file edits made during AI-assisted coding sessions?

Yes, you can create an audit log by building PostToolUse hooks that react after tool execution to record file edits and maintain audit trails. This adds post-execution visibility to track changes made during AI-assisted coding.

How do I set up project-specific automation checks for Claude Code?

You set up project-specific automation by creating hook configurations with tool matchers, executable scripts, and validation checks. These hooks apply safety rules and automation tailored to your specific software engineering project environment.

Does configuring Claude Code hooks require changing Claude's internal behavior?

No, configuring Claude Code hooks does not require changing Claude's internal behavior. Hooks operate externally by inspecting commands before execution and reacting after tool execution to enforce rules and add visibility.

What is the best way to prevent accidental force pushes when using Claude Code?

The best way to prevent accidental force pushes is implementing PreToolUse guardrails that inspect Git commands before execution and block destructive operations. This creates a safety layer enforcing git safety without modifying Claude directly.