Catch intent conflicts before code conflicts.

Foremerge is the open-source coordination protocol for coding agents, built above Git. Claude Code in one worktree, Codex in another: agents from any provider share intent, semantic claims, dependencies, provisional ChangeSets, decisions, and verification through one store, so plans collide in a queryable database, not in your merge.

$ curl -fsSL https://foremerge.com/install.sh | sh

The problem

Git sees two clean trees. The plans already collide.

Agent A · worktree ../payments-stripe
Replace PaymentService with StripePaymentService
symbol:PaymentService
Agent B · worktree ../payments-paypal
Add PayPal support to PaymentService
symbol:PaymentService
HIGH · replace_vs_extend · rule FM-C001

One agent removes the extension point the other depends on. No overlapping lines, no diff, nothing for Git to flag until both implementations exist and the rework is expensive. Foremerge compares declared scopes and intent language before implementation and raises an explainable, advisory finding. No hard locks, no LLM in the detection path.

Quickstart

Have your agent set it up.

Foremerge is one binary. The fastest path is to let the agent you already use do the install and wire itself in, then follow the protocol from that point on.

Paste this into Claude Code, Codex, or Cursor

Run it from inside the repository you want to coordinate. Change the check in step 4 to whatever this repository's real test command is.

Set up Foremerge in this repository so we can coordinate parallel agents. 1. Install it: curl -fsSL https://foremerge.com/install.sh | sh 2. Initialize: foremerge init 3. Wire this client and any others in use: foremerge setup all 4. Register the check I should be validated against, for example: foremerge checks set test -- cargo test --all-targets 5. Confirm: foremerge doctor --client all Then read the Foremerge skill that step 3 installed for this client and follow it from now on: publish your intent with semantic scopes before editing, claim the scope, and check for conflicts before you start.

Or install it yourself

A checksum-verified binary for macOS and Linux, or from crates.io if you have Rust. Windows binaries are on the releases page.

$ curl -fsSL https://foremerge.com/install.sh | sh
$ cargo install --locked foremerge

Then, once per repository

setup all installs the skill and MCP entry for Claude Code, Codex, and Cursor. Your client will ask before enabling anything.

$ foremerge init && foremerge setup all && foremerge doctor --client all

Two agents can now publish conflicting intents and see the finding above before either writes a line. Full documentation is in the docs directory.

How it fits

A shared awareness layer. Git stays the repository.

Every agent keeps its own isolated worktree. Coordination state lives in one SQLite database under the repository's Git common directory, so linked worktrees share it automatically. Mutations update typed projections, materialize graph edges, and append a hash-chained semantic event in a single transaction.

CLI

One binary

Register agents, publish intents, claim scopes, query who is changing what, and gate ChangeSets, with --json for scripting.

MCP

Seven focused tools

register_agent, publish_intent, claim_work, query_work, check_conflicts, publish_changeset, coordinate_with_agent, all over stdio. No daemon required.

JSON API

Loopback daemon

An authenticated local HTTP API with an OpenAPI schema, for harnesses that prefer HTTP to stdio.

INTENT CLAIMED IN_PROGRESS PROVISIONAL VALIDATED ACCEPTED COMMITTED

Agent-reported test results are provenance, never proof. Acceptance requires Foremerge-executed validation against the exact Git fingerprint of the candidate, and any change after validation makes that evidence stale.

Mixed fleets

One store, many models.

The protocol carries nothing provider-specific, so heterogeneous fleets are the design center, not an edge case. Any MCP-capable client drives the same seven tools; anything else uses the CLI or JSON API. Every ChangeSet records which agent and which model did what, validated how, against which exact Git fingerprint. A mixed Claude + Codex run doesn't just work: it produces the cross-model coordination data nobody else is collecting.

Worktree A
Claude Code · claude-fable-5
Worktree B
Codex · gpt-5.2-codex

Semantic scopes

Claims describe concepts, not file paths.

File paths miss API, schema, configuration, infrastructure, and cross-language collisions. Foremerge scopes name the thing that is actually contended:

symbol:PaymentServiceA class, function, or type
api:POST /v1/chargesAn endpoint or interface
schema:invoices.totalA table, column, or document shape
migration:2026-08-add-taxA one-shot ordered change
contract:payment-providerA cross-component agreement
env:STRIPE_API_KEYConfiguration and environment

Claims are leased and advisory: overlap produces a warning and shared context, never a lock. Twelve scope kinds ship in 0.1.0.

What it does not claim

Deliberately small, deliberately honest.

  • Conflict detection is deterministic, explainable, and heuristic. It can miss synonymous concepts and warn on compatible work.
  • Local-first: one machine, one SQLite store shared across worktrees. Multi-machine shared mode is on the roadmap, not in the box.
  • There are benchmark fixtures and a reproducible plan, but no published coordinated-vs-uncoordinated results yet. No performance claims until there are.
  • It does not replace code review, CI, architecture ownership, or Git hosting rules, and passing validation proves only what was actually run.

The full trust model is in docs/limitations.md. Protocol feedback on scope vocabulary, conflict evidence, and verification policy is the contribution we want most: start a discussion.