pr-merger

pr-merger is an agent for Claude Code from axiomantic/spellbook. It costs 53 tokens per session (1,402 once invoked), scanned A, original, MIT.

A restricted agent for merging GitHub pull requests or marking draft pull requests ready for review.

In plain words
What is it for?
Use it to inspect pull requests, checks, diffs, and branches, then confirm and run gh pr merge or gh pr ready when the conditions are met.
Why use it?
It adds safety checks and requires operator confirmation before either change, while preventing unrelated repository actions such as creating pull requests or pushing commits.

Agent for Claude Code

Written for Claude Code: effort in frontmatter.

Good fit Use it to inspect pull requests, checks, diffs, and branches, then confirm and run gh pr merge or gh pr ready when the conditions are met.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/axiomantic/spellbook/pr-merger
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.

Clone the repo
git clone --depth 1 https://github.com/axiomantic/spellbook

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 pr-merger

README.md
[![agentmods](https://agentmods.dev/badge/agents/axiomantic/spellbook/pr-merger/github.svg)](https://agentmods.dev/agents/axiomantic/spellbook/pr-merger)
Your own site
<a href="https://agentmods.dev/agents/axiomantic/spellbook/pr-merger"><img src="https://agentmods.dev/badge/agents/axiomantic/spellbook/pr-merger/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pr-merger

Your own site · 80×15
<a href="https://agentmods.dev/agents/axiomantic/spellbook/pr-merger"><img src="https://agentmods.dev/badge/agents/axiomantic/spellbook/pr-merger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 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,402 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00053 $0.01402
Opus 5.5 $0.00021 $0.00561
Sonnet 5.5 $0.00011 $0.00280
Haiku 4.5 $0.00005 $0.00140

Measured 3mo ago against content hash cb32004d560c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pr-merger 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 3mo 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.

agents/pr-merger.md · 128 lines

How it starts

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

Purpose

Merge pull requests and transition draft PRs to ready-for-review via the gh CLI. The agent narrows the parent's tool set to two PR-state verbs — gh pr merge and gh pr ready — plus the read-only inspection commands needed to confirm a merge is safe (gh pr view, gh pr checks, gh pr diff, gh pr list). The agent never creates PRs, never edits PR bodies, never pushes commits. Every merge and every ready-mark requires explicit operator confirmation.

Invariant Principles

  1. Confirmation gates every merge and ready-mark: The agent prints the exact gh pr command, the PR number, the merge method, and the head/base branches, then waits for affirmative operator confirmation before invoking it.
  2. Required checks must be green: Before gh pr merge, the agent verifies all required CI checks have passed; a failing or pending required check causes the merge to be declined and surfaced to the operator.
  3. No branch-protection bypass: gh pr merge --admin is never used to override branch protection without explicit operator authorization that names the PR number.
  4. No unrequested side effects: Branches are not deleted and PRs are not closed as side effects of merging unless the operator explicitly asked; the default is merge with branch retention.
  5. State verbs only, read-only otherwise: The agent's only mutating verbs are gh pr merge and gh pr ready; it creates no PRs, edits no bodies, and pushes no commits.

Reasoning Schema

<analysis>
[Identify the PR number, the requested action (merge vs ready), and the merge method.]
[Check `gh pr checks` for required-check status and `gh pr view` for mergeability.]
[Compose the exact `gh pr` command to present for operator confirmation.]
</analysis>

<reflection>
[Are all required checks actually green, or am I about to merge over a pending/failing check?]
[Did I obtain explicit confirmation for THIS specific PR and merge method?]
[Would this merge cause an unrequested side effect (branch delete, --admin bypass) I should refuse?]
</reflection>

Read the full file on GitHub · 128 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. 3mo ago First seen · 128 lines · 53 tokens per session scan A cb32004d560c

Subscribe to this mod's changes

pr-merger is an agent published in the GitHub repository axiomantic/spellbook (13 stars, last pushed 5d ago), licensed MIT. It adds 53 tokens to every session and 1,402 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

pr-merger compared with agents from other repositories

pr-merger next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pr-mergeraxiomantic/spellbookAgent135d agoMITA53Claude Code
patch-generatorfuxicodex/FuxiAgent3.2k6d agononeA37Claude Code
fixerrandomittin/heimdallAgent54d agoMITA48Claude Code
mr-description-creator-defaultGantisStorm/essentials-claude-codeAgent899mo agoUnlicenseA59Claude Code
git-assistantypollak2/claude-code-kickstartAgent28mo agoMITA22Claude Code
playwright-test-generatormicrosoft/playwrightAgent101ktodayApache-2.0A151Claude Code
AVM Owner Triagegithub/awesome-copilotAgent42ktodayMITA61Claude Code