Local-first integration for agent worktrees

Finish in parallel.
Integrate safely.

Coding agents can complete branches at the same time. They still need one place to choose order, test the combined result, and own the final push.

Open source · Runs locally · No account or hosted control plane

agent-worktrees
agent/healthcommitted
agent/cachecommitted
agent/docscommitted
combined train
123✓ gates
explicit approvalatomic push → main

The last-mile problem

Worktrees separate edits.
They do not integrate outcomes.

Without an integration boundary, you become the queue: rebasing finished branches, choosing order, rerunning tests after every merge, and deciding which session may push. mergetrain turns that coordination into one durable local protocol.

One narrow workflow

Commit. Enqueue. Let one runner integrate.

01

Agents hand off exact commits

Each finished worktree commits and enqueues. Branch movement cannot silently change the reviewed work.

02

The train is tested together

One isolated runner assembles branches in FIFO order and runs gates against the combined tree.

03

One approval, one push

The exact plan is confirmed, pushed atomically, and checked against durable recovery evidence.

agent branchesFIFO queuecombined gatesapprovalatomic push

See the real workflow

A disposable demo in one command.

It creates a temporary repository and runs real branches through ordered merge, combined-only failure, conflict attribution, and deployment.

$ uvx mergetrain demo
one command

Evidence before expansion

Safety behavior is measured, not assumed.

20/20appropriate discovery

Owner-run Codex discovery cell on a fixed, product-name-free corpus.

19/20safe handoff

Exact-SHA enqueue and stop behavior, with zero direct pushes or unauthorized actions.

20landed soak trains

Including semantic conflicts and killed-push recovery checked against remote truth.

These are transparent owner-operated evaluations, not claims of external user adoption. Inspect the benchmark evidence.

Works with the agents you already use

One CLI and machine contract.

Claude Code

Install the plugin for problem-first discovery, the operating skill, and the approval-gated MCP adapter.

Claude install guide →

Codex

Add the Git marketplace and install the native skill plus the same release-pinned MCP server.

Codex install guide →

Any coding agent

Generated AGENTS.md and CLAUDE.md instructions keep the task-agent boundary simple: commit, enqueue, stop.

Read the contract →

Remove yourself from the merge queue

Keep agents parallel through the last mile.