pr

pr is a command for Claude Code from KhaledSaeed18/dotclaude. It costs 89 tokens per session (738 once invoked), scanned A, original, MIT.

A GitHub command that takes the current branch through the steps needed to open a pull request: checking its state, committing changes if approved, pushing it, and creating the request with GitHub's command-line tool.

In plain words
What is it for?
Use it to turn completed branch work into a pull request, link the related issue, choose the repository's default base branch, and update an existing request when one is already open.
Why use it?
It removes the need to repeat branch checks, commit preparation, push setup, and pull-request writing by hand. It also avoids creating a duplicate request or working directly on a protected branch.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

Part of the git plugin — 9 skills, 3 commands shipped together

Good fit Use it to turn completed branch work into a pull request, link the related issue, choose the repository's default base branch, and update an existing request when one is already open.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/khaledsaeed18/dotclaude/pr
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/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install git, the plugin that ships this one along with the rest of its 9 skills, 3 commands.

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/khaledsaeed18/dotclaude/pr/github.svg)](https://agentmods.dev/commands/khaledsaeed18/dotclaude/pr)
Your own site
<a href="https://agentmods.dev/commands/khaledsaeed18/dotclaude/pr"><img src="https://agentmods.dev/badge/commands/khaledsaeed18/dotclaude/pr/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

Your own site · 80×15
<a href="https://agentmods.dev/commands/khaledsaeed18/dotclaude/pr"><img src="https://agentmods.dev/badge/commands/khaledsaeed18/dotclaude/pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 738 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.00089 $0.00738
Opus 5.5 $0.00036 $0.00295
Sonnet 5.5 $0.00018 $0.00148
Haiku 4.5 $0.00009 $0.00074

Measured 24d ago against content hash 38f06f6609f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 24d 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-plugin/plugins/git/commands/pr.md · 42 lines

How it starts

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

Context

Options: $ARGUMENTS

Branch, upstream, and default base:

!git branch --show-current 2>/dev/null; git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "(no upstream)"; gh repo view --json defaultBranchRef --jq .defaultBranchRef.name 2>/dev/null

Uncommitted:

!git status --short 2>/dev/null | head -20

Commits on this branch:

!git log --oneline $(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null)..HEAD 2>/dev/null

Existing PR for this branch:

!gh pr view --json number,url,state 2>/dev/null || echo "(none)"

Task

  1. Refuse on a protected branch. If the current branch is the default branch (or main/master/develop), stop and ask for a feature branch; do not create one silently.
  2. If a PR already exists, print its URL and offer to update the body instead of creating a duplicate.
  3. Uncommitted changes: if any, ask whether to commit them first. If yes, apply the git-commit skill for one commit (explicit staging, repo rules, no AI mentions). If no, proceed with what is committed and say the working tree still has changes.
  4. Push with git push -u origin <branch> after confirming the branch and remote. A rejected push (non-fast-forward) is reported, never forced.
  5. Write the PR with the pr-description skill from git diff <base>...HEAD and the commit messages: a title under 70 characters in the repo's convention, and a body with what changed, why, risk, and how it was tested. If a PR template exists (.github/pull_request_template.md), fill its sections instead. If the arguments include an issue number, add Closes #<n>.
  6. Show the title, body, base, and draft status, then ask for a yes before gh pr create --base <base> --title ... --body-file ... (--draft when asked). Base defaults to the repo's default branch.
  7. Report the PR URL. Do not enable auto-merge, request reviewers, or add labels unless asked.

Inspired by

The role and scope follow the commit-commands plugin's /commit-push-pr command in Anthropic's claude-code repository. That repository is not open-licensed, so nothing is copied from it; every line here was written for this registry.

Read the full file on GitHub · 42 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. 24d ago First seen · 42 lines · 89 tokens per session scan A 38f06f6609f7

Subscribe to this mod's changes

pr is a command published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed yesterday), licensed MIT. It adds 89 tokens to every session and 738 once invoked, about $0.0004 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-09-22.