pr

pr is a command for Claude Code from ibm-granite/granite.build. It costs 14 tokens per session (1,168 once invoked), scanned A, original, Apache-2.0.

A command that formats, checks, reviews, and creates or updates a GitHub pull request against the main branch. A pull request is a proposed code change submitted for review before it is merged.

In plain words
What is it for?
Use it to prepare a branch, run formatting and lint checks, review changes, and open or update a pull request.
Why use it?
It puts the repository checks and pull-request steps in one ordered workflow and stops when a required step fails.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions 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/ibm-granite/granite.build/pr
Clone the repo
git clone --depth 1 https://github.com/ibm-granite/granite.build

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/ibm-granite/granite.build/pr.svg)](https://agentmods.dev/commands/ibm-granite/granite.build/pr)
Your own site
<a href="https://agentmods.dev/commands/ibm-granite/granite.build/pr"><img src="https://agentmods.dev/badge/commands/ibm-granite/granite.build/pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 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,168 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.1 $0.00014 $0.01168
Opus 5 $0.00007 $0.00584
Sonnet 5 $0.00003 $0.00234
Haiku 4.5 $0.00001 $0.00117

Measured yesterday against content hash 59f6cc1edaff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pr 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 yesterday.

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/pr.md · 112 lines

How it starts

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

PR for granite.build

You are helping a developer create or update a pull request in the upstream repo (ibm-granite/granite.build) targeting the main branch. Follow these steps in order, stopping if any step fails.

Fork issue number (if provided): $ARGUMENTS

Step 0: Detect worktree context

  1. Check if we are running inside a git worktree:

    git rev-parse --is-inside-work-tree && git worktree list --porcelain
    

    If the current directory is a secondary worktree (not the main working tree), note this — all git operations work normally from worktrees since they share remotes and history.

  2. If $ARGUMENTS is empty, try to auto-detect the issue number from the branch name:

    BRANCH=$(git branch --show-current)
    

    If $BRANCH matches the pattern issue-<N>-*, extract <N> as the fork issue number. Inform the user:

    Auto-detected issue #N from branch name <branch>

  3. Derive the fork owner:

    FORK_OWNER=$(git remote get-url origin | sed -E 's|.*[:/]([^/]+)/.*|\1|')
    

Step 1: Pre-flight checks

  1. Confirm we are NOT on the main branch — we should be on an issue branch
  2. Run git status to check for uncommitted changes
  3. If there are unstaged/uncommitted changes, ask the user whether to stage and commit them before proceeding. Always commit with git commit -s (sign-off) — the upstream repo enforces the DCO check.
  4. Check if a PR already exists for this branch:
    gh pr list --repo ibm-granite/granite.build --head "$FORK_OWNER":<current-branch-name> --state open --json number,url
    
    Save the result — this determines whether we create or update.

Step 2: Format and lint (PR files only)

Only check files that will be in the PR — those changed between upstream/main and HEAD.

  1. Get the list of Python files changed in this PR:
    git diff upstream/main...HEAD --name-only -- '*.py'
    
  2. If there are Python files, run isort --profile black and black on each file
  3. If there are Python files, run pylint and mypy --disable-error-code=import-untyped directly on each changed file
  4. If linting produces errors, show them to the user and ask whether to fix them or proceed anyway
  5. If formatting changed any files, stage and commit them with git commit -s -m "style: auto-format via pre-commit" (the -s sign-off is required by the upstream DCO check)

Read the full file on GitHub · 112 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. yesterday First seen · 112 lines · 14 tokens per session scan A 59f6cc1edaff

Subscribe to this mod's changes

pr is a command published in the GitHub repository ibm-granite/granite.build (44 stars, last pushed yesterday), licensed Apache-2.0. It adds 14 tokens to every session and 1,168 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-09-04.