Foremerge CLI
A CLI and MCP server where parallel coding agents declare what they will change and see intent conflicts before any code
- 521 ★ on the repository
- Last commit
Extended access
Why this level
- Installing through `curl ... | sh` runs a script from foremerge.com, and `foremerge setup` adds an MCP entry and a skill to client settings
- Foremerge itself runs the registered validation commands in your repository, so register only fast and safe ones
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/foremergeDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Installing through `curl ... | sh` runs a script from foremerge.com, and `foremerge setup` adds an MCP entry and a skill to client settings
- Foremerge itself runs the registered validation commands in your repository, so register only fast and safe ones
This is third-party code. Review the repository files before installing.
What it does
Foremerge helps several coding agents work on one repository in separate git worktrees without undoing each other. Git compares text and notices when two agents edit the same part of a file. Say one agent moves every caller onto `StripePaymentService` while another adds PayPal to the old `PaymentService`. No lines overlap, and the merge goes through. The PayPal work ends up stranded on a class nobody calls. Before editing, each agent publishes an intent: a kind of scope (`symbol`, `api`, `schema`, `config`, `file` and others), a key and an operation such as `replace` or `extend`. Intents live in a SQLite database inside the `.git` directory, so every agent on the machine sees them: Claude Code, Codex, Cursor. The conflict detector uses no model and gives the same answer for the same input. Work moves from intent to acceptance. The agent declares and claims a scope, edits the code and publishes a ChangeSet. Foremerge then runs the validations set with `foremerge checks set` and accepts the change. The package includes a short `fmg` command, a `--json` mode and the MCP server `foremerge mcp`.
Who it is for. For developers who run several agents in parallel in different worktrees and want to learn about clashing plans before the merge.
Good fit when
- Two or three agents work on one repository in separate worktrees
- One task replaces a component while another extends it, and git stays silent at merge
- You want to check a plan before work starts with `foremerge conflicts check`
- You need a record of accepted changes: each entry carries the agent, the model, the validation result and a hash-chained event log
Not a fit when
- You work with a single agent: there is nobody to coordinate with
- Agents run on different machines: coordination across computers is outside the project's scope
- You need hard file locks: Foremerge only warns
- You need a mature, stable interface: the project is at version 0.5.1 and public schemas may still change
Example request
Before editing, publish an intent to replace PaymentService with StripePaymentService and check whether any other agent is working on the same thing.Limitations
Foremerge stays an MVP until 1.0: public schemas may change and no benchmark results are published yet. Coordination works on one computer. The database lives at `<git-common-dir>/foremerge/state.sqlite3`, and placing that file on a network share gives no distributed safety.
Prebuilt binaries exist for macOS, Linux and Windows. The npm package currently ships for macOS and Linux with glibc, and on Windows you take the binary from the releases page. Building from source needs Rust 1.85 or newer, and the examples in the guide need a recent Git and `jq`.
Foremerge does not merge, rebase, cherry-pick or push. It shows overlaps, keeps a log and runs validations. The hash-chained event log is tamper evidence and does not act as a remote user's signature.
How to disable. Remove the `foremerge` MCP entry and the skill file from the settings of every client you ran `foremerge setup` for. Then delete the `foremerge` binary (it lives in `~/.local/bin` by default) and the `foremerge` directory inside the repository's git directory.
FAQ
How is Foremerge different from git?
Git catches overlapping lines. Foremerge compares declared intents: if one agent replaces `PaymentService` and another extends it, the warning arrives before any code, even when the files differ.
How do I install Foremerge?
On macOS and Linux use `curl -fsSL https://foremerge.com/install.sh | sh` or `npm install -g foremerge`. The installer puts the `foremerge` and `fmg` commands in `~/.local/bin`. Then run `foremerge init` in your repository.
Does Foremerge lock files or agents?
No. Warnings are advisory, so one crashed agent does not stall the others. You record your decision about a conflict with `foremerge assess record`.
Does Foremerge use a model to find conflicts?
No. The detector compares declared scopes and operations, so the wording of a plan does not change the result. "Consolidate payments onto Stripe" and "Replace PaymentService with Stripe" reach the same verdict.
How do I connect Foremerge to Claude Code, Codex and Cursor?
Run `foremerge setup all`, or `foremerge setup claude`, `foremerge setup codex` and `foremerge setup cursor` for one client. The command installs the skill and the MCP entry and leaves other settings alone. `foremerge doctor --client all` checks the result.
Discussion
No questions or reviews yet.
Related
CLI toolsA skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
Karpathy-inspired Claude Code guidelines
Karpathy-Inspired Claude Code Guidelines
Four principles in one CLAUDE.md against common LLM coding mistakes: silent assumptions, overengineering, drive-by edits
A plugin and skill that makes the agent write minimal code: reuse, stdlib and native platform features come first
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Garry Tan's skill suite that turns Claude Code into a virtual team: product, architecture, design, review, QA and shipping
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Repository stars | Main difference |
|---|---|---|---|
| Foremerge (this entry) | no | 521 | |
| Weave | no | 1,331 | a git merge driver that removes false conflicts after the edits |
| Worktrunk | no | 9,420 | the `wt` command for creating and managing git worktrees for parallel agents |
| Claude Squad | no | 8,656 | a terminal app that runs several agent sessions |
README in short
The core is written in Rust and rests on a local SQLite store, the git CLI and validation runs from a given argv. The repository holds benchmark scenarios in `benchmarks/scenarios`, a recorded session in `examples/terminal-session.txt` and architecture decision records in `docs/adr`.