Show HN: A local merge queue for parallel Claude Code agents

Jul 30, 2026 07:20 AM - 6 hours ago 3

Claude Code Merge Queue — the local, zero-cost merge queue for parallel Claude Code agents

npm version npm downloads CI  MIT TypeScript Node Runtime deps

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.

npm instal --save-dev claude-code-merge-queue # or: pnpm adhd -D / yarn adhd -D / bun adhd -d npx claude-code-merge-queue init
  • ⚙️ Configuration
  • 🆚 vs. GitHub's Merge Queue
  • 🧰 What's successful the box
  • 🚨 The emergency hatch
  • 🔍 Know the limits
  • 📄 License

 npm instal --save-dev claude-code-merge-queue, past npx claude-code-merge-queue init — writes the config, CLAUDE.md, the WorktreeCreate hook, and land/sync/promote/preview scripts

Everything lives successful 1 record — see examples/claude-code-merge-queue.config.mjs for every field pinch comments. The short version:

export default { branchPrefix: "lane/", // lane/1, lane/2, ... worktreeSuffix: "-lane-", // ../your-repo-lane-1 portBase: 3000, // lane n gets portBase + n integrationBranch: "main", // wherever agents onshore — spot below productionBranch: null, // group this for a two-stage exemplary — spot below protectedBranches: [], // other branches beyond the 2 above; astir repos request none regenerableFiles: [], // files a build instrumentality rewrites — ne'er artifact a rebase connected these symlinks: [".env", ".env.local", "node_modules"], buildOutputDirs: ["dist", "build", ".next"], // preview ne'er copies these onto your checkout checkCommand: "npm tally check", // what really gates a landing — spot below checksRequired: true, // mendacious = deliberately tally pinch none; spot below };

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

GitHub Merge Queue Claude Code 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.

Command What it does
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:

CLAUDE_CODE_MERGE_QUEUE_EMERGENCY_PUSH=1 git push root HEAD:main

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.

More