Claude Code hooks that block conflicting commands between parallel sessions on one machine
Project details
claude-bulkhead is an open source (MIT) Claude Code plugin for people who run several Claude Code sessions on one machine. Its PreToolUse hooks read each shell command before it runs and block common conflicts: kills by a shared process name, a dev server on a port another session holds, unsafe git commands in a checkout another session works in, and heavy commands when RAM is low. Node only, no d
When several Claude Code sessions and their subagents share one machine, they get in each other's way. pkill node stops another session's dev server, two sessions start servers on the same port, git add -A sweeps another session's half-finished edits into a commit, and parallel test runs use up the RAM. claude-bulkhead adds PreToolUse hooks that check the command text before it runs. When a command matches one of these patterns, the hook blocks it and tells the agent the reason and a command to run instead.
pkill node, taskkill /IM node.exe). Kills by PID pass.bulkhead-slot queues them.git checkout, stash, add -A and commit -a in a tree another live session works in.du -sh ~.bulkhead scan replays the shell commands in your past Claude Code transcripts against the guards and shows what they would have stopped. It is read-only and sends nothing anywhere.
It parses command strings and is not a sandbox. Commands hidden in scripts, functions or aliases are not seen. A project's .claude/bulkhead.json can relax the guards for that repository.
/plugin marketplace add dooly6276/claude-bulkhead
/plugin install bulkhead@bulkhead
Comments
0Start the conversation
Share the first comment.