safety-hooks

Enforce layered safety checks on Claude Code write and edit operations.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/HurleySk/claude-cicd-safety-skill --skill safety-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-hooks
Source: https://github.com/HurleySk/claude-cicd-safety-skill/tree/main/skills/safety-hooks
Command: npx skills add https://github.com/HurleySk/claude-cicd-safety-skill --skill safety-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protect production environments from accidental agent modifications by enforcing layered safety checks on Claude Code operations, providing deterministic guards alongside a semantic review for risky actions.

Core Features & Use Cases

  • Deterministic PreToolUse gate that denies or asks when risky operations are detected and prevents write/edit to production assets.
  • LLM-backed semantic review as a second line of defense to catch subtler issues that script checks may miss.
  • Destructive-operation guards for Git, cloud CLI tools, and package installations with explicit user confirmations.
  • Audit, setup, and integration workflow to generate safety-rules.json and wire hooks into Claude Code settings.

Quick Start

Create and configure safety hooks for your project by running the setup workflow to generate rules, place hooks in the repository, and wire them into Claude Code settings.

Frequently Asked Questions about safety-hooks

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

FAQPage Schema
How do I prevent accidental edits to production environments when using Claude Code?

You can prevent accidental edits to production environments by enforcing layered safety hooks that intercept write, edit, and deployment operations. This Skill applies deterministic PreToolUse checks to deny risky actions before execution.

What's the best way to block destructive Git or cloud CLI commands in automated workflows?

Blocking destructive Git or cloud CLI commands requires deterministic guards that require explicit user confirmation before execution. This Skill intercepts risky deployment operations using a JSON safety rules file and Bash PreToolUse hooks.

Do I need Node.js to set up safety hooks for Claude Code write operations?

Yes, you need a Node.js environment to parse the JSON safety rules file used by the safety hooks. The setup workflow generates this rules file and wires the Bash-based PreToolUse hook into your Claude Code settings.

How does a semantic review catch risky agent modifications that deterministic script checks miss?

A semantic review acts as a second line of defense after deterministic checks by evaluating the intent behind operations. It catches subtle risky modifications to production assets that rigid script rules may overlook.

Can I define risky directories and blocked branches for my production safety rules?

Yes, you can define production indicators, risky directories, and blocked branches within a JSON safety rules file. The setup workflow generates this configuration file to customize the gatekeeping behavior for your repository.