pr

A command that creates a GitHub pull request, which is a request for others to review and merge code changes. It examines branch differences and commit messages to draft the request.

In plain words
What is it for?
Use it to compare a working branch with its base branch, generate a pull-request title and description, detect related Linear issues, and create the request with GitHub CLI.
Why use it?
It removes the manual work of assembling a pull request and can connect the request to related Linear issues, which are work items in the Linear project-tracking service.

Command

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/javiermrcom/awesome-claude-code/pr
Clone the repo
git clone --depth 1 https://github.com/javiermrcom/awesome-claude-code
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,293 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.00012 $0.02293
Opus 5 $0.00006 $0.01146
Sonnet 5 $0.00002 $0.00459
Haiku 4.5 $0.00001 $0.00229

Measured yesterday against content hash b3c6b785db93, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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.

plugins/git-guardian/commands/pr.md · 295 lines

How it starts

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

Smart Pull Request Command

This command creates a GitHub PR by:

  1. Analyzing the diff between branches
  2. Reading commit messages to understand intent
  3. Detecting Linear issues from session context, branch names, and commits
  4. Automatically linking detected Linear issues
  5. Generating an intelligent title and description
  6. Creating the PR using GitHub CLI

Task

Create a pull request following these steps:

1. Gather Information

First, collect all necessary information:

# Get current branch if not specified
BRANCH="${branch:-$(git rev-parse --abbrev-ref HEAD)}"

# Get default base branch if not specified
BASE="${base:-$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')}"

# Get repository info
REPO_INFO=$(gh repo view --json owner,name)
REPO_OWNER=$(echo "$REPO_INFO" | jq -r '.owner.login')
REPO_NAME=$(echo "$REPO_INFO" | jq -r '.name')

# Get the diff
DIFF=$(git diff "$BASE...$BRANCH")

# Get commit messages
COMMITS=$(git log "$BASE..$BRANCH" --pretty=format:"- %s" --reverse)
2. Detect Linear Issues

Analyze multiple sources to detect related Linear issues:

Detection Sources (in priority order):

  1. Session Context: Scan the current conversation for Linear issue references (IA-XXX, ENG-XXX, etc.)
  2. Branch Name: Extract issue IDs from branch name patterns:
    • feature/IA-123-description
    • IA-456/fix-something
    • bugfix/IA-789
  3. Commit Messages: Look for issue references in commit messages:
    • feat: add feature (IA-123)
    • Closes IA-456
    • Related to IA-789

Detection Logic:

# Pattern for Linear issues (TEAM-NUMBER format)
LINEAR_PATTERN="[A-Z]{2,4}-[0-9]+"

# Extract from session context (highest priority)
# Note: This requires analyzing the conversation history for Linear issue mentions

# Extract from branch name
BRANCH_ISSUES=$(echo "$BRANCH" | grep -oE "$LINEAR_PATTERN" | head -1)

# Extract from commit messages
COMMIT_ISSUES=$(echo "$COMMITS" | grep -oE "$LINEAR_PATTERN" | sort -u)

# Combine all detected issues (session context takes priority)
DETECTED_ISSUES="$SESSION_ISSUES $BRANCH_ISSUES $COMMIT_ISSUES"

Read the full file on GitHub · 295 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 · 295 lines · 12 tokens per session scan A b3c6b785db93

Subscribe to this mod's changes

pr is a command published in the GitHub repository javiermrcom/awesome-claude-code (3 stars, last pushed 10mo ago), licensed MIT. It adds 12 tokens to every session and 2,293 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-31.