Prevents destructive operations (rm -rf, force push, DROP TABLE, etc.) on production systems or during autonomous agent runs. Supports cautious, freeze, and guard modes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code:safety-guardThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- 在生产系统上工作时
三种保护模式:
在执行破坏性命令前拦截并发出警告:
监控的模式:
- rm -rf(尤其是 /、~ 或项目根目录)
- git push --force
- git reset --hard
- git checkout .(丢弃所有更改)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish(意外发布)
- 任何带有 --no-verify 的命令
检测到时:显示命令的作用,要求确认,建议更安全的替代方案。
将文件编辑锁定到特定目录树:
/safety-guard freeze src/components/
在 src/components/ 之外的任何 Write/Edit 都会被阻止并给出解释。当你希望智能体专注于一个区域而不触碰无关代码时非常有用。
两种保护同时激活。自主智能体的最高安全级别。
/safety-guard guard --dir src/api/ --allow-read-all
智能体可以读取任何内容,但只能写入 src/api/。破坏性命令在任何地方都会被阻止。
/safety-guard off
使用 PreToolUse 钩子拦截 Bash、Write、Edit 和 MultiEdit 工具调用。在允许执行之前,根据活动规则检查命令/路径。
codex -a never 会话启用~/.claude/safety-guard.lognpx claudepluginhub aaione/everything-claude-code-zhBlocks destructive commands like rm -rf, git --force, DROP TABLE, docker prune, and restricts file edits to specified directories. Use on production systems and with autonomous agents.
Prevents destructive operations on production systems and autonomous agents by intercepting dangerous commands, restricting edits to a directory, or combining both protections.
Blocks destructive Bash commands like rm -rf, DROP TABLE, git force-push, reset --hard, and restricts file edits to a specific directory. Use for protection on critical systems.