merge-prs

merge-prs is a command for Claude Code from xiaolai/vmark. It costs 15 tokens per session (1,096 once invoked), scanned A, original, ISC.

A command for reviewing and merging open pull requests, which are proposed code changes awaiting review. It processes them one at a time and handles branch conflicts that require rebasing.

In plain words
What is it for?
Use it to merge selected pull requests, your open pull requests, or pull requests whose branches match a pattern.
Why use it?
It brings together checks, review status, merge readiness, and conflict handling before code is merged.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/xiaolai/vmark/merge-prs
Clone the repo
git clone --depth 1 https://github.com/xiaolai/vmark

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for merge-prs

README.md
[![agentmods](https://agentmods.dev/badge/commands/xiaolai/vmark/merge-prs.svg)](https://agentmods.dev/commands/xiaolai/vmark/merge-prs)
Your own site
<a href="https://agentmods.dev/commands/xiaolai/vmark/merge-prs"><img src="https://agentmods.dev/badge/commands/xiaolai/vmark/merge-prs.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,096 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.01096
Opus 5 $0.00008 $0.00548
Sonnet 5 $0.00003 $0.00219
Haiku 4.5 $0.00002 $0.00110

Measured 4d ago against content hash 3f1e1de414cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

merge-prs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/merge-prs.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Merge PRs

Safely review and merge open pull requests. Sequential processing with rebase handling between merges.

Input

$ARGUMENTS

Phase 1: Discover PRs

Parse $ARGUMENTS to determine which PRs to process:

Input Scope
#12 #34 #56 Specific PR numbers
--mine All open PRs authored by current user
--pattern fix/issue-* PRs whose head branch matches the glob
(empty) Same as --mine

Fetch PR details:

gh pr list --author @me --state open --json number,title,headRefName,statusCheckRollup,reviewDecision,mergeable

If no open PRs found: report "No open PRs to process" and STOP.

Phase 2: Pre-merge Review

For each PR, collect and display a status table:

| # | Title | Branch | Checks | Mergeable | Action |
|---|-------|--------|--------|-----------|--------|
| 12 | fix: resolve X (fixes #123) | fix/issue-123-slug | ✅ pass | ✅ yes | Ready |
| 34 | feat: add Y (fixes #456) | feat/issue-456-slug | ❌ fail | ✅ yes | Blocked |
| 56 | fix: handle Z (fixes #789) | fix/issue-789-slug | ✅ pass | ⚠️ conflict | Needs rebase |

Status checks

For each PR:

gh pr checks {N}

Classification

Checks Mergeable Status
Pass Yes Ready — can merge
Fail Any Blocked — checks must pass first
Pass Conflict Needs rebase — will rebase before merge
Pending Any Waiting — checks still running

Present the table to the user and ask for confirmation before proceeding.

Options to offer:

  • Merge all ready PRs (skip blocked/waiting)
  • Merge specific PRs by number
  • Cancel

Phase 3: Sequential Merge

Process PRs one at a time in the order confirmed by the user.

For each PR:

3a. Final check

gh pr view {N} --json mergeable,statusCheckRollup,mergeStateStatus
  • If checks failed since Phase 2: skip, report, continue to next.
  • If conflict detected: attempt rebase (Phase 3b).

3b. Rebase if needed

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 154 lines · 15 tokens per session scan A 3f1e1de414cf

Subscribe to this mod's changes

merge-prs is a command published in the GitHub repository xiaolai/vmark (548 stars, last pushed 2d ago), licensed ISC. It adds 15 tokens to every session and 1,096 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.