# Foremerge

Foremerge keeps a shared list of what each coding agent plans to touch, so clashing plans surface before anyone writes code.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 518
- Author: naw103
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/naw103/foremerge
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/foremerge

## What it does

Foremerge is a coordination protocol for coding agents that sits above Git. Every agent keeps its own isolated worktree, yet announces its target before editing — a function like `sendEmail`, say. Those announcements live in a small database inside the project's `.git` folder, so Claude, Codex and Cursor on the same machine read the same picture.

When two plans collide, Foremerge names both agents, explains the clash and suggests how to split the work. Its own example: one agent swaps `PaymentService` for `StripePaymentService` while another adds PayPal to the old `PaymentService`. No lines overlap, Git merges both happily, and the PayPal code ends up attached to a class nobody calls. Foremerge compares the declared scopes and operations (`replace` versus `extend`) and raises a `HIGH` advisory before either agent writes anything.

Nothing gets locked and no agent is stopped — the warnings are advisory, so you stay in charge. A deterministic detector judges collisions rather than a model, which means identical inputs always give the same verdict. Manual setup needs a recent Git and `jq`; the binary installs into `~/.local/bin` via the install script, or from npm on macOS and Linux with glibc. Building from source takes Rust 1.85+. Coordination across separate machines is out of scope.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- catch two agents undoing each other before either commits
- split parallel work across worktrees without hand-checking overlaps
- see which agent is about to touch what, right now
- register the check an agent's result must pass
- explain why two edits in different files still break each other

## Example prompts
- Publish your intent for `sendEmail` and check for conflicts before editing.
- Register the `test` check with `foremerge checks set test -- cargo test --all-targets`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
