create-pr

A command that creates a GitHub Pull Request, a request for maintainers to review and merge code changes. It compares the chosen working branch with the main branch and prepares the request details.

In plain words
What is it for?
Use it to prepare a pull request from the current or specified branch, include extra instructions, and summarize the relevant changes for review.
Why use it?
It removes the repetitive work of comparing branches and writing a clear pull-request title and description. It also checks whether an unpushed branch exists before proceeding.

Command for 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/endorhq/rover/create-pr
Clone the repo
git clone --depth 1 https://github.com/endorhq/rover

Made for: Claude Code.

Per session 0 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,409 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00000 $0.01409
Opus 5 $0.00000 $0.00705
Sonnet 5 $0.00000 $0.00282
Haiku 4.5 $0.00000 $0.00141

Measured 2d ago against content hash 683553587c0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-pr scanned grade A with 1 finding 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 2d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Refactored push command to use the Git library instead of direct spawnSync calls Improved error handling with consistent GitError exceptions
.claude/commands/create-pr.md · 140 lines

How it starts

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

Create a GitHub pull request

Create a GitHub Pull Request. The user also requests the following instructions for the creation of this Pull Request: "$ARGUMENTS". Ignore if empty.

Compare the changes between the branch in the user instructions or the current on and the main branch. Prioritize the branch provided in the user instructions if it exists.

Follow these rules to create the pull request content:

  1. Take into account the user instructions if provided

  2. When the user provides a branch name that it's different from the current one:

    • Do not run git checkout or running any command that changes the current user workspace. This is IMPORTANT
    • Use diff and log commands comparing the given branch and main
    • Do not run git push. Check if the given branch exists on the remote. If not, ask the user to push it manually and WAIT for his/her confirmation before continuing. This is IMPORTANT
  3. Use a clear and concise title that summarizes the most relevant change in the pull request. The title follows the conventional commit format we use in this project.

    fix: manage invalid name error when creating a new task Refactor the git commands into a separate library

    Fix an issue

  4. The pull request body must be informative, clear, and concise. Use a neutral language that explain the changes so users can quickly identify the changes in the pull request.

  5. Do not include any checklist at the end

  6. Do not include any "Created by Claude" comment at the end

  7. Use GitHub markdown format in the body. For example, use the code blocks to show pieces of code, inline code blocks to highlight methods in paragraphs and list items, mermaid diagrams for complex pull requests, and tables when required.

  8. Follow this template:

    Changes

    Enumerate the major and most important changes in the pull request. Keep the list clear, short and concise.

    Notes

    An optional section to indicate any other relevant information, major architectural change, future work, other changes that were not part of the task by were implemented in this pull request. You can also include a mermaid diagram if the changes are complex and a diagram might help to understand them.

    Changes

    • Added push() method to the Git class with support for setting upstream branches
    • Added remoteUrl() method to retrieve git remote URLs
    • Added uncommitedChanges() method to get list of uncommitted files
    • Refactored push command to use the Git library instead of direct spawnSync calls Improved error handling with consistent GitError exceptions
    • Updated push command to use new exit utility functions (exitWithError, exitWithSuccess, exitWithWarn)

    Notes

    Temporarily removed the Pull Request push feature to improve the overall process.

    Changes

    • Removed interactive conflict resolution prompts and manual resolution flow
    • Added comprehensive merge-related methods including mergeBranch(), getMergeConflicts(), abortMerge(), and continueMerge()
    • Better merge conflict detection and reporting

    Notes

    The merge command flow is now simpler, so the user does not need to provide many input to complete it.

    Here you have a diagram with the new flow:

    flowchart TD
    Start([rover merge taskId]) --> ValidateTaskId{Valid Task ID?}
    ValidateTaskId -->|No| Error1[Error: Invalid task ID]
    ValidateTaskId -->|Yes| LoadTask
    
    LoadTask --> CheckCompleted{Task Completed?}
    CheckCompleted -->|No| Error3[Error: Task not completed]
    CheckCompleted -->|Yes| CheckUncommitted{Has Uncommitted<br/>Changes in Main?}
    
    CheckUncommitted -->|Yes| Error5[Error: Commit or stash changes first]
    CheckUncommitted -->|No| CheckChanges{Has Worktree Changes<br/>or Unmerged Commits?}
    
    CheckChanges -->|No| Success1[✓ No changes to merge]
    CheckChanges -->|Yes| ConfirmMerge{User Confirms<br/>Merge?}
    
    ConfirmMerge -->|No| Cancelled[Merge Cancelled]
    ConfirmMerge -->|Yes| AttemptMerge[Merge Task Branch]
    
    AttemptMerge --> MergeResult{Merge<br/>Successful?}
    
    MergeResult -->|Yes| Success2[✓ Task Merged Successfully]
    MergeResult -->|No| [Notify user about errors]
    

Read the full file on GitHub · 140 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. 2d ago First seen · 140 lines · 0 tokens per session scan A 683553587c0c

Subscribe to this mod's changes

create-pr is a command published in the GitHub repository endorhq/rover (270 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,409 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.