Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
Hacker News · 2026/7/30 00:20:16
Show HN: A local merge queue for parallel Claude Code agents
AI 中文解读
这是一个能让多个AI编程助手同时在你的电脑上协同工作、却不打架的免费工具——叫做Claude Code Merge Queue。简单说,当好几个AI程序像多辆车一样抢着改代码时,容易发生“追尾”(冲突)或“红灯无效”(测试失败)。这个工具就像一位本地交警,让它们排好队,一个个来,每次合并前还会自动检验,确保改动不出错。最重要的是,它完全跑在你自己的电脑上,不用额外付云端服务费。对于开发者来说,这意味着可以放心让多个AI一起帮忙写代码、跑测试、修bug,效率翻倍,而且小团队甚至个人也能享受过去大公司才有的自动合并与质量保障。普通用户可能不会直接用到它,但背后由AI辅助开发的软件会更快、更稳定地交付,你用的App或网站出bug的概率也会降低。
Claude Code Merge Queue 🚦
The local, zero-cost merge queue for parallel Claude Code agents. Several
agents land, build, and test at the same time — this serializes it so push
races, redundant heavy builds, and shared-resource test flakiness can't happen.
⚡ Quickstart
npm install --save-dev claude-code-merge-queue # or: pnpm add -D / yarn add -D / bun add -d
npx claude-code-merge-queue init
Contents
⚙️ Configuration
🆚 vs. GitHub's Merge Queue
🧰 What's in the box
🚨 The emergency hatch
🔍 Know the limits
📄 License
⚙️ Configuration
Everything lives in one file — see
examples/claude-code-merge-queue.config.mjs for every
field with 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", // where agents land — see below
productionBranch: null, // set this for a two-stage model — see below
protectedBranches: [], // extra branches beyond the two above; most repos need none
regenerableFiles: [], // files a build tool rewrites — never block a rebase on these
symlinks: [".env", ".env.local", "node_modules"],
buildOutputDirs: ["dist", "build", ".next"], // preview never copies these onto your checkout
checkCommand: "npm run check", // what actually gates a landing — see below
checksRequired: true, // false = deliberately run with none; see below
};
A malformed config (empty branch names, a negative port, productionBranch
equal to integrationBranch, ...) fails loud with every problem listed,
the moment any command loads it — not a mysterious failure three steps
later.
🆚 vs. GitHub's Merge Queue
GitHub Merge Queue
Claude Code Merge Queue
Private repo
Enterprise Cloud only
Any plan, any repo
Cost per landing
GitHub Actions minutes, every queue attempt
$0 — runs on your own machine
Requires
A pull request
Nothing — direct rebase + push
Same idea — serialize landings, test before merge, keep history clean — run
locally instead of in someone else's billed cloud.
🧰 What's in the box
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 across every lane, machine-wide.
claude-code-merge-queue land
Rebases and pushes your lane onto the integration branch through a FIFO queue, so two lanes are never mid-push at once. Agents run this themselves.
claude-code-merge-queue sync
Fast-forwards your main checkout so a dev server actually sees what just landed — and re-installs dependencies if the lockfile changed.
claude-code-merge-queue promote
Ships the integration branch to production. Human-only — never in an agent's instructions, never automated.
claude-code-merge-queue preview
Instantly mirrors a lane's live working tree — uncommitted changes included — onto the main checkout, so you can look at it without a build.
claude-code-merge-queue port
Prints a lane's dev-server port, derived from its own directory name.
claude-code-merge-queue prune
Removes already-landed sibling lane worktrees on demand.
A pre-push hook makes land non-optional: a direct git push straight to
the integration branch is rejected, with the actual command to run
instead, and the same hook runs checkCommand before allowing a landing
through — no checkCommand configured means every push fails by default.
There's a way out for every block (see 🚨 The emergency hatch), but it
takes naming the specific branch, not a generic flag.
📝 What init writes
claude-code-merge-queue.config.mjs — integrationBranch and checkCommand auto-detected.
CLAUDE.md (or appends to yours) — tells Claude Code to land its own
work once green, without be
分享
阅读原文 ↗