【开源自荐】claude-bulkhead:在命令执行前拦截编程 Agent 破坏性操作的钩子
还没有人认领这个 Issue。
评估
调研方向
This is a self-promotion post in a weekly newsletter list, not a request for a code change, so there is no file or test to start from. The linked repository dooly6276/claude-bulkhead holds the PreToolUse hooks; a newcomer who wants to help would need the maintainer to state a specific task first. Done would mean the issue is closed or a concrete change is agreed, and it should not be picked up as a first contribution.
由索引模型根据 Issue 内容生成。
描述
claude-bulkhead:在命令执行前拦截编程 Agent 的破坏性操作
claude-bulkhead 是一个开源项目(MIT 协议,零依赖),是一组 PreToolUse 钩子,适用于 Claude Code,也支持 Codex、Gemini CLI、Copilot CLI、Cursor 和 opencode。它在 Agent 执行 shell 命令之前做检查,命中危险操作就直接拦下。
项目地址:https://github.com/dooly6276/claude-bulkhead
几个特点
- 拦截变量为空时的
rm -rf(例如rm -rf "$VAR/"实际删到根目录),以及rm -rf .git。 - 拦截会误伤其他会话或桌面应用的
pkill/killall,也拦截抢占其他会话正在使用的端口。 - 拦截
git add -A把其他会话还没提交的改动一起提交进去。 - 每次拦截都会在提示里告诉 Agent 应该改用哪条安全的命令,Agent 可以直接重试,不需要人工介入。
- 零依赖,不需要额外安装运行库。
怎么用
按仓库 README 里的说明,把钩子配置到你使用的 Agent 即可,安装步骤和各个 Agent 的配置写法都在 README 里。
我是 claude-bulkhead 的维护者。
- 主要语言
- 没有语言数据
- 星标
- 1.9k
- 派生
- 74
- 平均合并
- 2 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenGithubs/weekly 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
OpenGithubs/weekly#233 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
OpenGithubs/weekly#230 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
OpenGithubs/weekly#157 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
OpenGithubs/weekly#106 ·
-
难度 5/5 一周以上 新手友好度 20/100
OpenGithubs/weekly#232 ·
查看 OpenGithubs/weekly 的全部 Issue
相似的 Issue
-
fix(tool/internal/setup): clearer errors when loading rule files from OTELC_RULES可能已有人在做 @NeoSamyak 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 65/100
open-telemetry/opentelemetry-go-compile-instrumentation#1946 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
juandresrodca/AdminForge#69 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
dotnet/diagnostics#6293 ·
维护者通常 1 天内回复