Repository navigation
claude-bulkhead: BeforeTool guards for running Gemini CLI next to other agents on one machine #30251
dooly6276
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I often run Gemini CLI in one terminal while other coding agents work in other terminals on the same machine. Each agent behaves as if it owns the computer, so the breakages I kept seeing were collisions: a
pkill nodethat stopped another agent's dev server, a second server started on a port that was already taken, or agit add -Athat committed edits another session had not finished.claude-bulkhead is an MIT licensed set of guard hooks for that situation. It began as a Claude Code plugin and can register the same guards for Gemini CLI:
This adds a
BeforeToolhook with matcherrun_shell_commandto~/.gemini/settings.json, after saving a backup of the file. Running it without--writeprints the change instead of making it.The hook checks each shell command against what is live on the machine: which session owns the processes a kill would reach, who is listening on a port, how much memory is left, and whether another live session has uncommitted changes in the same tree. Ordinary commands pass. When a command would hurt another session, Gemini CLI receives a block reason that says what to run instead, such as killing the PID it started or using a free port.
npx claude-bulkhead explain -- <command>shows each guard's verdict for a command without executing it.There are no dependencies and nothing is sent off the machine. I would like to hear from people who run Gemini CLI next to other agents, in particular about any command it blocks that it should allow.
https://github.com/dooly6276/claude-bulkhead
All reactions