Orchestrating Parallel Claude Code Swarms Without Merge Chaos: Git Worktrees, File Leases, and Shared MCP Blackboards Benni Alencar, Chief AI Systems Architect at Benni OS, released claude-code-swarm, an open-source tool that coordinates multiple parallel Claude Code agents using isolated git worktree sandboxes, SQLite3 WAL file leases enforced in PreToolUse hooks, a shared MCP task blackboard, global USD spending caps, and pre-merge AST gates. The design targets four failure modes of naive parallelism: file clobbering, .git/index.lock contention, runaway multi-terminal token bills, and merge conflicts. Blocked workers receive exit code 2 with the lease holder's ID and are redirected to another task on the blackboard. By Benni Alencar — Chief AI Systems Architect at Benni OS https://benni-os.net . Canonical article & interactive benchmarks at benni-os.net https://benni-os.net/blog/en/claude-code-swarm-parallel-worktrees-file-leases-mcp-blackboard.html . Every power user eventually hits the same scaling wall: one Claude Code session is fast, so opening four terminal tabs in the same repository ought to be four times faster. In practice, uncoordinated parallel coding agents behave like four developers editing the same working directory with zero locks, zero communication, and zero shared budget. Within minutes, naive parallelism collapses into four predictable failure modes: src/auth.py , Worker B rewrites it, and Worker A's next Edit or Write call clobbers Worker B's patch without warning. .git/index.lock contention. Runaway Multi-Terminal Token Bills: Four agents stuck in competing test-fix loops multiply API burn by 4×—with no global USD circuit breaker across terminals. Core Architectural Principle: Parallelism without mutual exclusion is just distributed race conditions. Benni-OS/claude-code-swarm https://github.com/Benni-OS/claude-code-swarm turns independent Claude Code processes into a deterministic swarm using isolated git worktree sandboxes, SQLite3 WAL file leases enforced in PreToolUse , a shared MCP blackboard, global USD caps, and pre-merge AST gates. Instead of letting agents race inside one directory or coordinate via fragile markdown files, claude-code-swarm separates filesystem isolation , concurrency control , and task coordination into three deterministic layers: flowchart TD M "Shared MCP Task Blackboard