setup-hooks

Install PreToolUse safety hooks into Claude Code settings.

15|4|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/Kasempiternal/Claude-Agent-System --skill setup-hooks-kasempiternal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-hooks
Source: https://github.com/Kasempiternal/Claude-Agent-System/tree/main/claude-agent-system-plugin/skills/setup-hooks
Command: npx skills add https://github.com/Kasempiternal/Claude-Agent-System --skill setup-hooks-kasempiternal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enhances your Claude Code environment's security by installing safety hooks that intercept potentially dangerous commands, secret access, and git pushes, prompting you for confirmation before proceeding.

Core Features & Use Cases

  • Command Interception: Prevents accidental or malicious execution of destructive shell commands.
  • Secret Protection: Guards against unauthorized access to sensitive files like .env or SSH keys.
  • Git Push Guard: Ensures you consciously approve any git push or gh pr create actions.
  • Use Case: Before pushing code that might contain sensitive information or before running a command like rm -rf, Claude will ask for your explicit approval, preventing costly mistakes.

Quick Start

Install the CAS safety hooks by running the setup-hooks skill.

Frequently Asked Questions about setup-hooks

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

FAQPage Schema
How do I add a confirmation prompt before Claude Code runs dangerous shell commands?

To add a confirmation prompt before Claude Code runs dangerous shell commands, you can install PreToolUse hooks into your `~/.claude/settings.json` file to intercept sensitive operations and require explicit user approval before execution.

Can I prevent Claude Code from automatically pushing code to git or creating pull requests?

Yes, you can prevent Claude Code from automatically pushing code by installing a git push guard hook that intercepts `git push` and `gh pr create` actions, prompting you for conscious approval before any remote changes are executed.

How do I restrict access to .env files and SSH keys when using Claude Code?

You can restrict access to `.env` files and SSH keys by installing secret protection hooks that intercept unauthorized access to sensitive files, prompting you for confirmation before Claude Code can read or modify those specific secrets.

Do I need to close other Claude Code sessions before modifying settings.json to install hooks?

Yes, you need to close all other active Claude Code sessions before modifying `~/.claude/settings.json` to install hooks, ensuring the new safety configurations are loaded properly without conflicts from concurrent sessions.

What types of safety hooks are available for securing a Claude Code environment?

Available safety hooks for securing a Claude Code environment include command interception for destructive shell commands, secret protection for sensitive file access, and a git push guard for remote repository actions, all prompting for user confirmation.