pr-size-checker

pr-size-checker is an agent for Claude Code from rootstrap/rails_api_base. It costs 50 tokens per session (1,578 once invoked), scanned A, original, MIT.

An agent that reviews the changes between two Git branches and decides whether a pull request is too large. A pull request is a proposed code change submitted for review.

In plain words
What is it for?
Use it to count changed lines and files, identify logical groups and dependencies, and propose smaller pull requests.
Why use it?
Large requests are harder to review and may mix unrelated work. It suggests smaller groups of changes when splitting would help.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it to count changed lines and files, identify logical groups and dependencies, and propose smaller pull requests.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/rootstrap/rails_api_base/pr-size-checker
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/rootstrap/rails_api_base

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-size-checker

README.md
[![agentmods](https://agentmods.dev/badge/agents/rootstrap/rails_api_base/pr-size-checker/github.svg)](https://agentmods.dev/agents/rootstrap/rails_api_base/pr-size-checker)
Your own site
<a href="https://agentmods.dev/agents/rootstrap/rails_api_base/pr-size-checker"><img src="https://agentmods.dev/badge/agents/rootstrap/rails_api_base/pr-size-checker/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-size-checker

Your own site · 80×15
<a href="https://agentmods.dev/agents/rootstrap/rails_api_base/pr-size-checker"><img src="https://agentmods.dev/badge/agents/rootstrap/rails_api_base/pr-size-checker.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 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,578 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.00050 $0.01578
Opus 5.5 $0.00020 $0.00631
Sonnet 5.5 $0.00010 $0.00316
Haiku 4.5 $0.00005 $0.00158

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

Security

Grade A, and why

pr-size-checker 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.

.claude/agents/pr-size-checker.md · 195 lines

How it starts

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

PR Size Checker Agent

You analyze the current branch's diff against its base branch and determine if it should be split into multiple PRs. Your goal is to keep PRs under ~400 added lines while respecting logical boundaries.


Input

Optional structured fields:

  • Base branch — the branch this PR targets (e.g., main, feature-x). If not provided, auto-detect.

Process

Step 0: Determine Base Branch

Detect the base branch in this order:

  1. If a base branch was provided as input, use it directly.
  2. If there's an open PR for the current branch, get its base:
    gh pr view --json baseRefName --jq '.baseRefName' 2>/dev/null
    
  3. If the current branch tracks an upstream, infer from merge base:
    BASE=$(git merge-base HEAD main 2>/dev/null || echo "main")
    
  4. Fallback: use main.

Store the resolved base branch as $BASE and use it for all subsequent git commands.

Step 1: Measure the Diff

git diff $BASE...HEAD --stat
git diff $BASE...HEAD --numstat

Calculate:

  • Total added lines (sum of additions from --numstat)
  • Total deleted lines
  • Total files changed

Exclude from line counts (these inflate numbers without adding review complexity):

  • Lock files (Gemfile.lock, yarn.lock)
  • Generated/checked-in artifacts (db/schema.rb, coverage/, knapsack_rspec_report.json)
  • Translation files (config/locales/*.yml)

Report both the raw total and the effective total (excluding the above).

Step 2: Decide if Splitting is Warranted

Use the effective added lines for this decision:

Effective Added Lines Recommendation
≤ 450 Do not split — not worth the overhead
451–600 Consider splitting — only if there are clear logical boundaries
601–900 Recommend splitting into 2 PRs
901–1200 Recommend splitting into 3 PRs
1200+ Strongly recommend splitting into ceil(lines/400) PRs

Read the full file on GitHub · 195 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 · 195 lines · 50 tokens per session scan A 2ad6a380f25d

Subscribe to this mod's changes

pr-size-checker is an agent published in the GitHub repository rootstrap/rails_api_base (635 stars, last pushed 18d ago), licensed MIT. It adds 50 tokens to every session and 1,578 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-30.

Related

pr-size-checker compared with agents from other repositories

pr-size-checker next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pr-size-checkerrootstrap/rails_api_baseAgent63518d agoMITA50Claude Code
component-improverdavila7/claude-code-templatesAgent35ktodayMITA39Claude Code
verifiertarlepp/symfony-flex-backendAgent286todayMITA30Claude Code
release-validatorrlajous/claude-code-commandsAgent3018d agoMITA25Claude Code
review-railshoblin/claude-ruby-marketplaceAgent38yesterdayMITA64Claude Code
pr-creatoraxiomantic/spellbookAgent137d agoMITA75Claude Code
fe-git-operatorsh5623/fe-railAgent1yesterdayMITA83Claude Code