DA

damage-control

Installs and manages a security layer that blocks destructive bash commands and enforces file access protections.

Install

mkdir -p .claude/skills/damage-control && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2540" && unzip -o skill.zip -d .claude/skills/damage-control && rm skill.zip

Installs to .claude/skills/damage-control

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Install, configure, and manage the Claude Code Damage Control security hooks system. Use when user mentions damage control, security hooks, protected paths, blocked commands, install security, or modify protection settings.
223 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Block dangerous bash commands
  • Trigger confirmation dialogs for risky operations
  • Set paths with zero access
  • Configure read-only paths
  • Define paths where deletion is blocked
  • Test damage control configurations

How it works

The skill uses PreToolUse hooks to intercept and evaluate commands and file operations against predefined patterns and path protection levels, blocking or prompting for confirmation as configured.

Inputs & outputs

You give it
User requests for security configuration, commands, or file paths
You get back
Blocked operations, confirmation prompts, or modified security settings

When to use damage-control

  • Enable command pattern blocking
  • Protect secrets files from accidental modification
  • Set up read-only paths for configuration files
  • Configure security hooks for team environments

About this skill

Damage Control Skill

Defense-in-depth protection system for Claude Code. Blocks dangerous commands and protects sensitive files via PreToolUse hooks.

Overview

This skill helps users deploy and manage the Damage Control security system, which provides:

  • Command Pattern Blocking: Blocks dangerous bash commands (rm -rf, git reset --hard, etc.)
  • Ask Patterns: Triggers confirmation dialog for risky-but-valid operations (ask: true)
  • Path Protection Levels:
    • zeroAccessPaths - No access at all (secrets/credentials)
    • readOnlyPaths - Read allowed, modifications blocked
    • noDeletePaths - All operations except delete

Skill Structure

.claude/skills/damage-control/
├── SKILL.md                     # This file
├── patterns.yaml                # Shared security patterns (single source of truth)
├── cookbook/
│   ├── install_damage_control_ag_workflow.md
│   ├── modify_damage_control_ag_workflow.md
│   ├── manual_control_damage_control_ag_workflow.md
│   ├── list_damage_controls.md
│   ├── test_damage_control.md
│   └── build_for_windows.md
├── hooks/
│   ├── damage-control-python/   # Python/UV implementation
│   │   ├── bash-tool-damage-control.py
│   │   ├── edit-tool-damage-control.py
│   │   ├── write-tool-damage-control.py
│   │   ├── python-settings.json
│   │   └── test-damage-control.py
│   └── damage-control-typescript/  # Bun/TypeScript implementation
│       ├── bash-tool-damage-control.ts
│       ├── edit-tool-damage-control.ts
│       ├── write-tool-damage-control.ts
│       ├── typescript-settings.json
│       └── test-damage-control.ts
└── test-prompts/                # Test prompts for validation
    ├── sentient_v1.md
    ├── sentient_v2.md
    ├── sentient_v3.md
    └── sentient_v4.md

After Installation

The install workflow copies hooks and creates settings based on the chosen level:

Global Hooks

~/.claude/
├── settings.json                      # Hook configuration
└── hooks/
    └── damage-control/
        ├── patterns.yaml
        ├── bash-tool-damage-control.py (or .ts)
        ├── edit-tool-damage-control.py
        └── write-tool-damage-control.py

Project Hooks

<agents current working directory>/
└── .claude/
    ├── settings.json                  # Hook configuration (shared)
    └── hooks/
        └── damage-control/
            ├── patterns.yaml
            ├── bash-tool-damage-control.py (or .ts)
            ├── edit-tool-damage-control.py
            └── write-tool-damage-control.py

Project Personal Hooks

<agents current working directory>/
└── .claude/
    ├── settings.local.json            # Personal overrides (gitignored)
    └── hooks/
        └── damage-control/
            ├── patterns.yaml
            ├── bash-tool-damage-control.py (or .ts)
            ├── edit-tool-damage-control.py
            └── write-tool-damage-control.py

Cookbook

This section defines the decision tree for handling user requests. Based on what the user says, read and execute the appropriate workflow prompt.

Installation Pathway

Trigger phrases: "install damage control", "setup security hooks", "deploy damage control", "add protection"

Workflow: Read and execute cookbook/install_damage_control_ag_workflow.md

Modification Pathway

Trigger phrases: "help me modify damage control", "update protection", "change blocked paths", "add restricted directory"

Workflow: Read and execute cookbook/modify_damage_control_ag_workflow.md

Manual Control Pathway

Trigger phrases: "how do I manually update", "explain damage control config", "show me the settings"

Workflow: Read and execute cookbook/manual_control_damage_control_ag_workflow.md

Testing Pathway

Trigger phrases: - "test damage control", - "run damage control tests", - "verify hooks are working" - "damage control test this command <x>" - "damage control test this read to this path <x>" - "damage control test this write to this path <x>" - "damage control test this delete to this path <x>" - "damage control test this run this command <x>"

Workflow: Read and execute cookbook/test_damage_control.md

What it does:

  • Reads patterns.yaml to get all configured patterns and paths
  • Tests PreToolUse hooks (bash, edit, write) with exit code validation
  • Tests ask patterns with JSON output validation
  • Reports pass/fail for each test case
  • Provides summary of all results

Windows Build Pathway

Trigger phrases: "build for windows", "add windows patterns", "convert to windows", "windows damage control"

Workflow: Read and execute cookbook/build_for_windows.md

What it does:

  • Checks for existing installation
  • Adds Windows PowerShell and cmd patterns alongside Unix patterns
  • Creates cross-platform patterns.yaml that works on both systems

Direct Command Pathway

Trigger phrases: "update global read only paths to include X", "add /secret to zero access paths", "block command Y"

Action: Execute immediately without prompts - the user knows the system.

Examples:

  • "add ~/.credentials to zero access paths" → Edit patterns.yaml directly
  • "block the command 'npm publish'" → Add pattern to bashToolPatterns
  • "make /var/log read only" → Add to readOnlyPaths

Quick Reference

Settings File Locations

LevelPathScope
Global~/.claude/settings.jsonAll projects
Project.claude/settings.jsonCurrent project (shared)
Project Personal.claude/settings.local.jsonCurrent project (personal)

Path Protection Levels

TypeReadWriteEditDeleteUse Case
zeroAccessPathsNoNoNoNoSecrets, credentials
readOnlyPathsYesNoNoNoSystem configs, history
noDeletePathsYesYesYesNoImportant project files

Runtime Requirements

ImplementationRuntimeInstall Command
PythonUV (Astral)curl -LsSf https://astral.sh/uv/install.sh | sh
TypeScriptBuncurl -fsSL https://bun.sh/install | bash && bun add yaml

Exit Codes

CodeMeaning
0Allow operation
0Ask (JSON output triggers dialog)
2Block operation

Testing

Use the test prompts in test-prompts/ to validate the hooks:

  • sentient_v1.md - Tests rm -rf blocking (bashToolPatterns)
  • sentient_v2.md - Tests find -delete blocking (noDeletePaths)
  • sentient_v3.md - Tests ask patterns (SQL DELETE with ID)
  • sentient_v4.md - Tests simple command blocking

Run a test:

/project:test-prompts/sentient_v1

Related Files

When not to use it

  • When security hooks are not desired
  • When full access to all commands and paths is required

Limitations

  • Requires configuration of patterns and paths
  • Relies on PreToolUse hooks for enforcement
  • Python implementation requires UV (Astral) runtime

How it compares

This skill provides a configurable, automated defense-in-depth system for Claude Code, preventing dangerous actions before they execute, unlike manual oversight.

Compared to similar skills

damage-control side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
damage-control (this skill)27moReviewIntermediate
security-audit36moReviewIntermediate
security-best-practices76moNo flagsIntermediate
security-scanning-security-sast24moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

security-audit

ruvnet

Comprehensive security scanning and vulnerability detection. Includes input validation, path traversal prevention, CVE detection, and secure coding pattern enforcement. Use when: authentication implementation, authorization logic, payment processing, user data handling, API endpoint creation, file upload handling, database queries, external API integration. Skip when: read-only operations on public data, internal development tooling, static documentation, styling changes.

337

security-best-practices

openai

Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review/report, or secure-by-default coding help. Trigger only for supported languages (python, javascript/typescript, go). Do not trigger for general code review, debugging, or non-security tasks.

732

security-scanning-security-sast

sickn33

Static Application Security Testing (SAST) for code vulnerability analysis across multiple languages and frameworks

27

detecting-sql-injection-vulnerabilities

jeremylongshore

Detect and analyze SQL injection vulnerabilities in application code and database queries. Use when you need to scan code for SQL injection risks, review query construction, validate input sanitization, or implement secure query patterns. Trigger with phrases like "detect SQL injection", "scan for SQLi vulnerabilities", "review database queries", or "check SQL security".

35

cursor-prod-checklist

jeremylongshore

Execute production readiness checklist for Cursor IDE setup. Triggers on "cursor production", "cursor ready", "cursor checklist", "optimize cursor setup". Use when working with cursor prod checklist functionality. Trigger with phrases like "cursor prod checklist", "cursor checklist", "cursor".

434

lint-and-validate

davila7

Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis.

68

Search skills

Search the agent skills registry