cc safe 配置
- 作者仓库星标 29
- 作者仓库 cc-safe-setup
cc-safe-setup
Safety-first configuration for Claude Code. Prevents the accidents that happen when AI writes code autonomously.
What it does
Installs pre-built safety hooks into your Claude Code environment. These hooks run automatically before/after tool calls to block dangerous operations.
Categories:
- File protection: Block
rm -rf, prevent overwriting files outside project - Git safety: Prevent force-push to main, block
reset --hard - Credential guards: Stop
.envfiles from being committed or read by AI - Token optimization: Warn on large file reads, limit subagent spawning
- Quality gates: Detect lazy rewrites, verify claims before committing
Quick start
npx cc-safe-setup
This runs an interactive wizard that configures hooks based on your risk profile.
Install individual hooks
npx cc-safe-setup --install-example large-read-guard
npx cc-safe-setup --install-example prevent-rm-rf
npx cc-safe-setup --install-example git-force-push-block
Why hooks instead of CLAUDE.md rules
Rules in CLAUDE.md are suggestions — Claude can forget them. Hooks are enforced at the system level. A hook that blocks rm -rf cannot be overridden by the AI.
From 800+ hours of autonomous operation: the hooks that matter most are the ones you don't notice until something goes wrong.
Resources
- Repository: https://github.com/yurukusa/cc-safe-setup
- Hook Selector (find hooks for your setup): https://yurukusa.github.io/cc-safe-setup/hook-selector.html
- Token Checkup (diagnose waste): https://yurukusa.github.io/cc-safe-setup/token-checkup.html
- 流狐分类
- 安全
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @yurukusa · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 读取环境变量
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Installs pre-built safety hooks into your Claude Code environment. These hooks run automatically before/after tool calls to block dangerous operations. Categories: File protection: Block rm -rf, prevent overwriting files outside project
This runs an interactive wizard that configures hooks based on your risk profile.
Install individual hooks
Rules in CLAUDE.md are suggestions — Claude can forget them. Hooks are enforced at the system level. A hook that blocks rm -rf cannot be overridden by the AI. From 800+ hours of autonomous operation: the hooks that matter most are the ones you don't notice…
Repository: https://github.com/yurukusa/cc-safe-setup Hook Selector (find hooks for your setup): https://yurukusa.github.io/cc-safe-setup/hook-selector.html Token Checkup (diagnose waste): https://yurukusa.github.io/cc-safe-setup/token-checkup.html
# cc-safe-setup
Safety-first configuration for Claude Code. Prevents the accidents that happen when AI writes code autonomously.
## What it does
Installs pre-built safety hooks into your Claude Code environment. These hooks run automatically before/after tool calls to block dangerous operations.
**Categories:**
- **File protection**: Block `rm -rf`, prevent overwriting files outside project
- **Git safety**: Prevent force-push to main, block `reset --hard`
- **Credential guards**: Stop `.env` files from being committed or read by AI
- **Token optimization**: Warn on large file reads, limit subagent spawning
- **Quality gates**: Detect lazy rewrites, verify claims before committing
## Quick start
```bash
npx cc-safe-setup
```
This runs an interactive wizard that configures hooks based on your risk profile.
## Install individual hooks
```bash
npx cc-safe-setup --install-example large-read-guard
npx cc-safe-setup --install-example prevent-rm-rf
npx cc-safe-setup --install-example git-force-push-block
```
## Why hooks instead of CLAUDE.md rules
Rules in CLAUDE.md are suggestions — Claude can forget them. Hooks are enforced at the system level. A hook that blocks `rm -rf` cannot be overridden by the AI.
From 800+ hours of autonomous operation: the hooks that matter most are the ones you don't notice until something goes wrong.
## Resources
- Repository: https://github.com/yurukusa/cc-safe-setup
- Hook Selector (find hooks for your setup): https://yurukusa.github.io/cc-safe-setup/hook-selector.html
- Token Checkup (diagnose waste): https://yurukusa.github.io/cc-safe-setup/token-checkup.html 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> What it does → Quick start → Install individual hooks → Why hooks instead of CLAUDE.md rules → Resources
要点 -> Categories · File protection · Git safety · Credential guards · Token optimization · Quality gates
文件/命令 -> rm -rf · reset --hard · .env · before/after · CLAUDE.md · github.com/yurukusa/cc-safe-setup · yurukusa.github.io/cc-safe-setup/hook-selector.html · yurukusa.github.io/cc-safe-setup/token-checkup.html
内容 SHA-256 -> b46f196ae6ac
方法与流程
适用与边界
原文中的明确线索
rm -rf、reset --hard、.env、before/after、CLAUDE.md、github.com/yurukusa/cc-safe-setup、yurukusa.github.io/cc-safe-setup/hook-selector.html、yurukusa.github.io/cc-safe-setup/token-checkup.html