ghpr

ghpr is a command for coding agents 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

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

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

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/dwmkerr/claude-toolkit/ghpr
Clone the repo
git clone --depth 1 https://github.com/dwmkerr/claude-toolkit

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.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.svg" alt="Measured on agentmods" 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. 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 $0.00010 $0.00533
Opus 5 $0.00005 $0.00267
Sonnet 5 $0.00002 $0.00107
Haiku 4.5 $0.00001 $0.00053

Measured 4d ago against content hash 98cfa46d4651, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 10d ago), licensed MIT. It adds 10 tokens to every session and 533 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-08-30.