ghpr

ghpr is a command for Claude Code from dwmkerr/claude-toolkit. It costs 10 tokens per session (533 once invoked), scanned A, original, MIT.

A command that opens an existing GitHub pull request or creates one for the current branch. A pull request is a GitHub proposal to merge code changes into another branch.

In plain words
What is it for?
Use it after making changes on a Git branch to open the matching pull request in GitHub.
Why use it?
It removes the need to manually check whether a pull request already exists and prepare its details from branch commits.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the toolkit plugin — 15 skills, 3 commands, 1 agent shipped together

Good fit Use it after making changes on a Git branch to open the matching pull request in GitHub.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add dwmkerr/claude-toolkit
Claude Code
/plugin install toolkit

Made for: Claude Code.

Or install toolkit, the plugin that ships this one along with the rest of its 15 skills, 3 commands, 1 agent.

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 ghpr

README.md
[![agentmods](https://agentmods.dev/badge/commands/dwmkerr/claude-toolkit/ghpr/github.svg)](https://agentmods.dev/commands/dwmkerr/claude-toolkit/ghpr)
Your own site
<a href="https://agentmods.dev/commands/dwmkerr/claude-toolkit/ghpr"><img src="https://agentmods.dev/badge/commands/dwmkerr/claude-toolkit/ghpr/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 ghpr

Your own site · 80×15
<a href="https://agentmods.dev/commands/dwmkerr/claude-toolkit/ghpr"><img src="https://agentmods.dev/badge/commands/dwmkerr/claude-toolkit/ghpr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 533 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.00010 $0.00533
Opus 5.5 $0.00004 $0.00213
Sonnet 5.5 $0.00002 $0.00107
Haiku 4.5 $0.00001 $0.00053

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

Security

Grade A, and why

ghpr 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 1mo 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.

plugins/toolkit/commands/ghpr.md · 65 lines

What it actually says

GitHub Pull Request

Open or create a pull request for the current branch.

Context

  • Current branch: !git branch --show-current
  • Recent commits on this branch: !git log main..HEAD --oneline 2>/dev/null || git log origin/main..HEAD --oneline 2>/dev/null || echo "Unable to determine commits"

Instructions

Step 1: Check if PR exists (fast path)

Run the ghpr script:

${CLAUDE_PLUGIN_ROOT}/scripts/ghpr.sh
  • If it shows "✔ opened: ": The PR was opened in the browser. Confirm this to the user and stop.
  • If it shows "NO_PR": Continue to Step 2.

Step 2: Check for relevant skills

Before creating a PR, check available skills for any that might provide PR guidance:

  • Look for <project>-development skills (e.g., ark-development, typescript-development) if this is engineering work
  • Look for pull-request or pr-guidance skills
  • Review the conversation history for context about what was implemented

If relevant skills exist, invoke them to get project-specific PR conventions.

Step 3: Create PR (if none exists)

a. Analyze the branch name and commits to determine the type:

  • feat/ branch or feature commits → feat:
  • fix/ branch or bugfix commits → fix:
  • chore/ branch or maintenance commits → chore:
  • docs/ branch → docs:
  • refactor/ branch → refactor:

b. Draft a PR title following conventional commit format (e.g., feat: add ghpr command)

c. Draft a PR body using this format:

## Summary
- Brief description of changes

d. Present the suggested title and body to the user using AskUserQuestion:

  • Show the proposed title
  • Show the proposed body
  • Ask for confirmation or edits

e. If confirmed, create the PR:

gh pr create --title "..." --body "..."

f. Report the PR URL to the user.

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. 1mo ago First seen · 65 lines · 10 tokens per session scan A 98cfa46d4651

Subscribe to this mod's changes

ghpr is a command published in the GitHub repository dwmkerr/claude-toolkit (23 stars, last pushed 1mo ago), licensed MIT. It adds 10 tokens to every session and 533 once invoked, about $0.0000 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.