【开源自荐】claude-bulkhead:在命令执行前拦截编程 Agent 破坏性操作的钩子
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 5/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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 的维护者。
- Dominant language
- No language data
- Stars
- 1.9k
- Forks
- 76
- Avg merge
- 3h 36m
- Merged PRs (30d)
- 18
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenGithubs/weekly
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
OpenGithubs/weekly#263 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenGithubs/weekly#230 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenGithubs/weekly#157 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OpenGithubs/weekly#106 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 15/100
OpenGithubs/weekly#259 · 1 comment ·
Maintainers usually reply within 1 day
All issues in OpenGithubs/weekly
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Action: a `test` glob with a gem older than 1.9.0 fails with `no such file` and no version hintOpenbacklog enhancement github_actions priority: low risk: low
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
davidteren/mutineer#646 ·
Maintainers usually reply within 1 day
-
bug good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsotto/sotto-authenticator#139 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MiniMax-AI/minimax-code#639 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jonathanong/no-mistakes#5304 ·