claude-code-merge-queue
Local merge queue for parallel Claude Code agents
TLDR
SYNOPSIS
claude-code-merge-queue command [options]
DESCRIPTION
claude-code-merge-queue is a local, zero-cost merge queue for repositories where multiple Claude Code agents land work in parallel. It serializes rebase-and-push landings, runs a configurable check command before each landing, and coordinates worktree "lanes" so agents do not race on shared resources.Unlike GitHub's merge queue, it runs entirely on the developer's machine, does not require a pull request, and works on any plan or hosting setup. Configuration lives in claude-code-merge-queue.config.mjs. init writes that config, optional CLAUDE.md instructions, a WorktreeCreate hook, and package scripts.A pre-push hook can reject direct pushes to the integration branch and force agents through land. Emergency bypass uses CLAUDE_CODE_MERGE_QUEUE_EMERGENCY_PUSH=1.
COMMANDS
init
Detect integration branch and check command; write config, hooks, and scripts.land
Rebase and push the current lane onto the integration branch through a FIFO queue.sync
Fast-forward the main checkout to match what landed; reinstall dependencies if needed.promote
Ship the integration branch to production. Intended for humans only, not agents.preview / preview:restore
Mirror a lane's working tree onto the main checkout for inspection without a full build.port
Print a lane's assigned dev-server port.prune
Remove already-landed sibling lane worktrees.build-lock -- cmd
Run cmd under a machine-wide lock so builds do not overlap across lanes.hook worktree-create
Claude Code WorktreeCreate hook that assigns numbered lanes.
CAVEATS
There is no human review gate — only checkCommand passing allows a land. Locks are local to one machine. A slow check command caps throughput because the FIFO lock is held for the whole check. Rebase conflicts abort cleanly; agents must resolve and re-run land.