What is Claude Bulkhead?
Claude Bulkhead is a set of local hooks that checks coding-agent commands against active sessions on the same machine. It helps prevent one session from disrupting another by guarding shared processes, ports, memory and Git trees, and it can suggest a safer command when it blocks an action. It is designed for people running Claude Code sessions or subagents in parallel, and also supports other coding agents including Codex, Cursor, Gemini CLI and Copilot CLI.
Claude Bulkhead Features:
Process Guard: The kill-guard checks commands such as pkill node and taskkill against session-owned processes, then blocks attempts that could stop another session's work.
Port Guard: When another session is using a port, the port-guard blocks a conflicting server start and identifies a free port to use instead.
Git Tree Guard: The checkout-guard tracks sessions working in Git trees and can block broad staging, branch changes or worktree removal that could affect another session.
Resource Guards: Memory and disk guards check for low available RAM or heavy disk scans, while bulkhead-slot can queue heavy jobs until there is room.
Safety Checks: Basic command checks block risky operations including recursive deletion with an empty variable, deleting .git, force-pushing to main and overwriting uncommitted work.
Transcript Scan: The scan command replays past Claude Code shell commands against the guards, reports what they might have stopped and can produce a shareable summary with counts only.
Claude Bulkhead Benefits:
Protect Other Sessions: Keeping broad process and Git commands from crossing session boundaries helps preserve other developers' running services and unfinished changes.
Avoid Port Confusion: Identifying a free port before a conflicting server starts makes it less likely that a session will test the wrong branch's app.
Keep Work Moving: A blocked command comes with a safer alternative, giving the agent a path forward without requiring the user to diagnose every collision.
Reduce Resource Spikes: Checks on memory use and queued heavy jobs can help keep simultaneous builds and tests from overwhelming a shared machine.
Assess Past Commands: Reviewing transcripts gives users a way to see which safeguards would have mattered in their own sessions before relying on them.
Use Cases:
Parallel Worktrees: Run separate coding-agent sessions on different worktrees of one repository without letting a broad Git command sweep another session's edits into a commit.
Restart a Dev Server: Ask an agent to restart its app while other worktrees have Node-based development servers or test processes running on the same machine.
Concurrent Builds: Start builds, test suites or Playwright runs from several sessions and queue a heavy job when available memory is low.
Clean Up Sessions: End a coding session and have its lingering development servers, test workers and watchers reaped instead of left holding ports and memory.
Review Agent History: Scan a period of Claude Code transcripts to estimate how often past commands would have triggered guards before installing or sharing a summary.

