r/ClaudeCode • • 6h 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:

  1. 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).
  2. Silent cross-file breakage that git never catches: Agent A adds a required user_id param to send_email() in email.py; Agent B calls the old signature from reset.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.0M tokens, $0.99 vs integrator's 31.7 min, 43.8M tokens, $1.15 (~9 conflicts resolved).
  • 6-agent Polyglot Full-Stack (SQL + Python + TypeScript @/, 30 live E2E): 30/30, 0 conflicts, 8.8 min, 7.7M tokens, $0.40 vs integrator's 13.8 min, 8.2M tokens, $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 min vs 19.1 min ($0.69 vs $0.76).
  • 6-agent TypeScript app (48 tests): 48/48, 0 conflicts, 3.7 min vs 6.8 min ($0.16 vs $0.21).

How you use it (plugs into your existing agent — macOS, Linux, Windows)

  1. 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 via seamlock mcp). Then just ask your agent to plan and run parallel tasks with Seamlock.
  2. Direct CLI: seamlock run --tasks tasks.json --mode enforce --regions --test-cmd "npm test" + seamlock watch.
  3. Sidekick only (no orchestrator): seamlock worktrees --base main to check existing git worktrees live for silent contract breaks, or seamlock merge --base main b1 b2 --type-check.

Install: npx seamlock · uvx seamlock · brew install lucas-rus/tap/seamlock · cargo binstall seamlock-cli

Happy to answer questions on the tree-sitter contract diffing, region coherence protocol, or benchmark setup!

1 Upvotes

4 comments sorted by

•

u/AutoModerator 6h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/kantorcodes1 5h ago

In your finish gate you're preventing an agent from finishing when a contract that it relies on is stale.

I'm a maintainer for awesome-ai-plugins. People who are trying to find agent tools are searching our catalog.

Do you want to get Seamlock into the catalog?

1

u/Darkmaze22 5h ago

Hi! That would be amazing, I would really love for my tool to get more reach.

1

u/kantorcodes1 4h ago

Cool, thanks. Seamlock goes in as a single line in the catalog README, written by you. The contributing guide covers the format: https://github.com/hashgraph-online/awesome-ai-plugins/blob/main/CONTRIBUTING.md

Let me know when you get to sending it in as a pull request and I'll look out for it here.