
disler/Claude-Code-damage-control 是从 https://github.com/disler/claude-code-damage-control. 导入的特工技能候选
概览
disler/Claude-Code-damage-control 是从 https://github.com/disler/claude-code-damage-control. 导入的特工技能候选
概述(AI 翻译)
Claude Code 的深度防御。通过 PreToolUse 钩子阻止危险命令并保护敏感文件。
工作原理
路径防护等级
所有路径配置均位于patterns.yaml。每个层级提供不同的保护:
|路径类型 |读取 |写入 |编辑 |删除 |由 | 强制执行
|----------------- |---- |----- |---- |------ |----------------- |
|zeroAccessPaths |✗ |✗ |✗ |✗ |抨击、编辑、写作 |
|readOnlyPaths |✓ |✗ |✗ |✗ |抨击、编辑、写作 |
|noDeletePaths |✓ |✓ |✓ |✗ |仅限Bash |
零访问路径
完全无法访问——这些秘密和凭证永远不该被触碰。
只读OnlyPaths
允许读取,阻止修改——用于系统文件和配置。
不删除路径
除删除外的所有操作——保护重要文件免于意外删除。
损害控制技能
本项目包含一项Claude代码技能,提供交互式安装、修改和指导工作流程。该技能使用AskUserQuestion提示来引导你完成每一步。
技能触发
|说这个… |技能将… |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Claude Code Damage Control
Defense-in-depth protection for Claude Code. Blocks dangerous commands and protects sensitive files via PreToolUse hooks.
How It Works
┌─────────────────────────────────────────────────────────────────────┐
│ Claude Code Tool Call │
└─────────────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Bash │ │ Edit │ │ Write │
│ Tool │ │ Tool │ │ Tool │
└─────┬─────┘ └─────┬─────┘ └─────┬─────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ bash-tool- │ │ edit-tool- │ │ write-tool- │
│ damage-control │ │ damage-control │ │ damage-control │
│ │ │ │ │ │
│ • bashTool- │ │ • zeroAccess- │ │ • zeroAccess- │
│ Patterns │ │ Paths │ │ Paths │
│ • zeroAccess- │ │ • readOnlyPaths │ │ • readOnlyPaths │
│ Paths │ │ │ │ │
│ • readOnlyPaths │ │ │ │ │
│ • noDeletePaths │ │ │ │ │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
▼ ▼ ▼
exit 0 = allow exit 0 = allow exit 0 = allow
exit 2 = BLOCK exit 2 = BLOCK exit 2 = BLOCK
JSON = ASK
Path Protection Levels
All path configurations are in patterns.yaml. Each level provides different protection:
| Path Type | Read | Write | Edit | Delete | Enforced By |
|---|---|---|---|---|---|
zeroAccessPaths |
✗ | ✗ | ✗ | ✗ | Bash, Edit, Write |
readOnlyPaths |
✓ | ✗ | ✗ | ✗ | Bash, Edit, Write |
noDeletePaths |
✓ | ✓ | ✓ | ✗ | Bash only |
zeroAccessPaths
No access at all - for secrets and credentials that should never be touched.
zeroAccessPaths:
- ~/.ssh/
- ~/.aws/
- ~/.gnupg/
readOnlyPaths
Read allowed, modifications blocked - for system files and configs.
readOnlyPaths:
- /etc/
- ~/.bashrc
- ~/.zshrc
noDeletePaths
All operations except delete - protect important files from accidental removal.
noDeletePaths:
- .claude/hooks/
- .claude/commands/
Damage Control Skill
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add disler/claude-code-damage-control