The local, zero-cost merge queue for parallel Claude Code agents. Several agents land, build, and trial astatine the aforesaid clip — this serializes it truthful push races, redundant dense builds, and shared-resource trial flakiness can't happen.
- ⚙️ Configuration
- 🆚 vs. GitHub's Merge Queue
- 🧰 What's successful the box
- 🚨 The emergency hatch
- 🔍 Know the limits
- 📄 License
Everything lives successful 1 record — see examples/claude-code-merge-queue.config.mjs for every field pinch comments. The short version:
A malformed config (empty branch names, a antagonistic port, productionBranch equal to integrationBranch, ...) fails large pinch each problem listed, the infinitesimal immoderate bid loads it — not a mysterious nonaccomplishment 3 steps later.
🆚 vs. GitHub's Merge Queue
| Private repo | Enterprise Cloud only | Any plan, immoderate repo |
| Cost per landing | GitHub Actions minutes, each queue attempt | $0 — runs connected your ain machine |
| Requires | A propulsion request | Nothing — nonstop rebase + push |
Same thought — serialize landings, trial earlier merge, support history cleanable — run locally alternatively of successful personification else's billed cloud.
| claude-code-merge-queue hook worktree-create | A Claude Code WorktreeCreate hook. Plugs Claude Code Merge Queue's numbered lanes into Claude's native worktree creation. |
| claude-code-merge-queue build-lock -- <cmd> | Runs <cmd> — your build — serialized crossed each lane, machine-wide. |
| claude-code-merge-queue land | Rebases and pushes your lane onto the integration branch done a FIFO queue, truthful 2 lanes are ne'er mid-push astatine once. Agents tally this themselves. |
| claude-code-merge-queue sync | Fast-forwards your main checkout truthful a dev server really sees what conscionable landed — and re-installs limitations if the lockfile changed. |
| claude-code-merge-queue promote | Ships the integration branch to production. Human-only — ne'er successful an agent's instructions, ne'er automated. |
| claude-code-merge-queue preview | Instantly mirrors a lane's unrecorded moving character — uncommitted changes included — onto the main checkout, truthful you tin look astatine it without a build. |
| claude-code-merge-queue port | Prints a lane's dev-server port, derived from its ain directory name. |
| claude-code-merge-queue prune | Removes already-landed related lane worktrees connected demand. |
A pre-push hook makes onshore non-optional: a nonstop git push consecutive to the integration branch is rejected, pinch the existent bid to run instead, and the aforesaid hook runs checkCommand earlier allowing a landing through — nary checkCommand configured intends each push fails by default. There's a measurement retired for each artifact (see 🚨 The emergency hatch), but it takes naming the circumstantial branch, not a generic flag.
- claude-code-merge-queue.config.mjs — integrationBranch and checkCommand auto-detected.
- CLAUDE.md (or appends to yours) — tells Claude Code to onshore its own work erstwhile green, without being asked.
- .claude/settings.json — the WorktreeCreate hook wired in, without touching thing other already there.
- .husky/pre-push — created aliases appended to, if you already have Husky. If you don't, init tells you alternatively than silently penning to the untracked .git/hooks/pre-push.
- package.json scripts — land, sync, promote, preview, preview:restore, skipping immoderate you've already defined yourself.
- claude-code-merge-queue-preflight.mjs — a self-contained information net that runs earlier land/sync, truthful a old branch fails pinch a real diagnosis alternatively of a bare bid not found.
Every blocked push — the integration branch, productionBranch, anything in protectedBranches — has a existent measurement done it. One env var, no prompts, nary 2nd facet to remember:
This is simply a convention, not a difficult guarantee: it stops mistakes and stray pushes, not an adversarial supplier that sets the var itself.
- No quality reviews immoderate of this earlier it lands. checkCommand passing is the only gross — a existent trial suite and echo good look identical to this tool. Want a quality connected each change? This is missing that measurement connected purpose.
- Locks are crash-safe by PID liveness, not a timeout. termination -9 anything mid-claim and the adjacent process notices the PID is dormant and reclaims it — nary old locks, nary timeout to tune.
- One machine, not a fleet. The FIFO queue lives successful section temp retention — two machines landing astatine erstwhile conscionable get git's mean non-fast-forward rejection.
- Not a information boundary. Every guardrail present stops mistakes and convention drift, not an adversarial supplier — ammunition entree ever means git push --no-verify aliases editing the config connected purpose.
- A slow checkCommand is simply a existent throughput ceiling. The FIFO lock holds for its full long — a 3–4 infinitesimal suite caps you good under 20 landings/hour.
- Rebase conflicts abort, they ne'er guess. git rebase --abort connected any conflict, moving character near cleanable — CLAUDE.md tells the supplier to resolve it and re-run land.
MIT. Fork it, rename it, reason pinch the config style — that's the point.
English (US) ·
Indonesian (ID) ·