Mergetrain: A Local Merge Queue for Parallel Claude Code Sessions That Prevents Trampled Pushes
If you're running multiple Claude Code sessions in parallel, you've probably hit the trampling problem: branch A passes tests, branch B passes tests, but A-then-B breaks. Worktrees isolate editing, but not landing. And CLAUDE.md rules like "never push to main" hold until one session breaks them at the worst moment. Rules aren't enforcement.
Mergetrain is a local merge queue that solves this. It runs entirely on your machine — no server, no GitHub App, no CI service, no runtime dependencies. MIT licensed.
How It Works
- Each Claude Code session works in its own worktree and enqueues instead of pushing (
mergetrain enqueue). - A repo-owned pre-push hook blocks direct pushes to main.
- One runner assembles the queued branches into a "train" on top of origin/main, runs gates (tests + a full Unity build) once over the whole train, then pushes atomically.
mergetrain hubserves a read-only dashboard for every repo on the machine: who's running gates, what's ready to ship, what needs attention. Agents read the same info as JSON (hub status --json).- If your laptop dies mid-push,
mergetrain recoverasks the remote what actually landed and reconciles — nothing ships twice, nothing mislabeled. - Repos that must never see unattended deploys can be registered with
--no-daemon: visible on the board, never swept.
Getting Started
Install with pip: pip install mergetrain
Then run mergetrain init to scaffold the config plus a CLAUDE.md contract that your agents pick up automatically.
Dogfooding Results
Three weeks on a commercial game: 70+ trains landed, zero trampled pushes since.
Who Is This For?
Developers running parallel AI coding agents (Claude Code, etc.) who need a lightweight, local integration solution without relying on hosted PR pipelines or file locking.
📖 Read the full source: r/ClaudeAI
👀 See Also

LumaBrowser: Electron Browser Offloads DOM Parsing to Local LLMs for AI Agents
LumaBrowser is an Electron browser that offloads DOM parsing to local LLMs via OpenAI-compatible endpoints, helping autonomous agents avoid processing raw HTML. It uses models like Qwen 2.5 variants to identify UI elements and returns CSS selectors.

cc-session-utils: TUI Dashboard for Managing Claude Code Sessions and Costs
A developer built cc-session-utils, a terminal UI tool for managing Claude Code session files, tracking costs by model, cleaning orphaned sessions, and migrating data between projects. It requires Python 3.11+ and is built with Textual.

memora: Version-Controlled, Typed Memory for AI Agents – Git for AI Beliefs
memora is a CLI tool written in Rust that version-controls AI agent memory with typed, provenance-tracked, branchable, and mergeable capabilities.

LAP: 1,500+ API Specs Compiled for LLM Consumption to Reduce Claude Hallucinations
LAP is a tool that compiles 1,500+ real API specifications into a lean format optimized for LLMs, providing verified endpoints and parameters to prevent AI coding agents like Claude from hallucinating incorrect API calls.