r/ClaudeCode • u/Darkmaze22 • 11h ago
Tips & Workflows I built an open-source Rust CLI + MCP server to coordinate parallel AI coding agents at the symbol-contract level
If you've avoided running multiple coding agents in parallel because of merge conflicts (or tried git worktrees and got burned), you've probably seen both failure modes:
- Uncoordinated parallel agents fall apart: in our 12-agent CommonMark 0.31.2 benchmark (652 official spec tests), uncoordinated worktrees (
parallel-off) averaged ~9 merge conflicts and dropped to 199/652 passing (~302 integration-loss regressions). - Silent cross-file breakage that git never catches: Agent A adds a required
user_idparam tosend_email()inemail.py; Agent B calls the old signature fromreset.py. Clean git merge, both branches pass their own tests, broken together.
Running sequentially avoids conflicts but takes 65.1 min (3.1x slower). So I built Seamlock (Rust, MIT/Apache-2.0) — a local coherence engine + 12-tool MCP server that coordinates parallel agents at the symbol-contract level instead of locking whole files.
How it works
- Contract vs. body separation (tree-sitter): Body edits never block anyone. Breaking contract edits (signatures, types, SQL/Prisma/Protobuf/OpenAPI schemas, and cross-language HTTP routes like FastAPI/Express/Next.js <->
fetch) send surgical notices only to affected callers. - Live region coherence + AST-verified union: Pure two-sided insertions in the same file are combined via patience/diff3 + AST verification; genuine overlaps use region ownership and hand-offs.
- Finish gate: Blocks an agent from finishing while it depends on a stale contract or unresolved conflict.
Benchmarks (attached chart)
We didn't even benchmark against sequential — the primary comparison is head-to-head against a strong baseline: the same parallel agents plus a 13th AI merge-integrator agent (parallel-integrator), same models, reproducible harness:
- 12-agent Python CommonMark (652 spec tests, DeepSeek V4.1 Flash):
652/652, 0 conflicts,20.0 min,34.0Mtokens,$0.99vs integrator's31.7 min,43.8Mtokens,$1.15(~9 conflicts resolved). - 6-agent Polyglot Full-Stack (SQL + Python + TypeScript
@/, 30 live E2E):30/30, 0 conflicts,8.8 min,7.7Mtokens,$0.40vs integrator's13.8 min,8.2Mtokens,$0.33(5–6 conflicts resolved). (Honest note: on small ~200-line additive scaffolds, a quick post-hoc integrator pass can still be a few cents cheaper; live coordination pays off most on larger, coupled codebases.) - 5-agent Next.js/Postgres product sprint: 0 conflicts,
16.7 minvs19.1 min($0.69vs$0.76). - 6-agent TypeScript app (48 tests):
48/48, 0 conflicts,3.7 minvs6.8 min($0.16vs$0.21).
How you use it (plugs into your existing agent — macOS, Linux, Windows)
- Via MCP:
npm i -g seamlock && seamlock setup— auto-configures Claude Code, OpenAI Codex CLI, OpenCode, Cursor, Windsurf, Gemini CLI, VS Code/Copilot, and Antigravity (or any stdio MCP client viaseamlock mcp). Then just ask your agent to plan and run parallel tasks with Seamlock. - Direct CLI:
seamlock run --tasks tasks.json --mode enforce --regions --test-cmd "npm test"+seamlock watch. - Sidekick only (no orchestrator):
seamlock worktrees --base mainto check existing git worktrees live for silent contract breaks, orseamlock merge --base main b1 b2 --type-check.
Install: npx seamlock · uvx seamlock · brew install lucas-rus/tap/seamlock · cargo binstall seamlock-cli
- Repo: https://github.com/lucas-rus/seamlock
- Benchmark harness & raw logs: https://github.com/lucas-rus/seamlock-bench
Happy to answer questions on the tree-sitter contract diffing, region coherence protocol, or benchmark setup!
