python-sdk: Command for Claude Code

.claude/commands/review-pr.md

review-pr is a command for Claude Code from modelcontextprotocol/python-sdk. It costs 0 tokens per session (908 once invoked), scanned A, original, MIT.

A command for reviewing a GitHub pull request, which is a proposed set of code changes submitted for review.

In plain words
What is it for?
Use it to resolve a pull request reference, inspect its metadata and diff, read related issues and comments, and validate the proposed changes.
Why use it?
It gathers the change list, discussion, linked issues, and review information in a defined order, reducing the chance of missing important context.

Command for Claude Code ✓ vendor

Written for Claude Code: $ARGUMENTS substitution.

This is modelcontextprotocol/python-sdk's own configuration. It tells Claude Code how to work on python-sdk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything python-sdk configures →

About the project

modelcontextprotocol/python-sdk is the official Python toolkit for building Model Context Protocol servers and clients, which let large-language-model applications access standardized tools, data, and prompts. It is for developers creating MCP integrations, and the catalogue entries provide instructions, skills, and commands for working with it.

modelcontextprotocol/python-sdk · 24,708 stars · on GitHub · py.sdk.modelcontextprotocol.io

Reuse

Borrowing it

Nothing to install: this file belongs to modelcontextprotocol/python-sdk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/.claude/commands/review-pr.md
Clone the repo
git clone --depth 1 https://github.com/modelcontextprotocol/python-sdk

Made for: Claude Code.

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 review-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/modelcontextprotocol/python-sdk/review-pr/github.svg)](https://agentmods.dev/commands/modelcontextprotocol/python-sdk/review-pr)
Your own site
<a href="https://agentmods.dev/commands/modelcontextprotocol/python-sdk/review-pr"><img src="https://agentmods.dev/badge/commands/modelcontextprotocol/python-sdk/review-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 review-pr

Your own site · 80×15
<a href="https://agentmods.dev/commands/modelcontextprotocol/python-sdk/review-pr"><img src="https://agentmods.dev/badge/commands/modelcontextprotocol/python-sdk/review-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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 908 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.00000 $0.00908
Opus 5.5 $0.00000 $0.00363
Sonnet 5.5 $0.00000 $0.00182
Haiku 4.5 $0.00000 $0.00091

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

Security

Grade A, and why

review-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 2mo 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/commands/review-pr.md · 119 lines

How it starts

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

Review the pull request: $ARGUMENTS

Follow these steps carefully. Use the gh CLI for all GitHub interactions.

Step 1: Resolve the PR

Parse $ARGUMENTS to determine the PR. It can be:

  • A full URL like https://github.com/owner/repo/pull/123
  • A owner/repo#123 reference
  • A bare number like 123 (use the current repo)
  • A description — search for it with gh pr list --search "<description>" --limit 5 and pick the best match

Once resolved, fetch the PR metadata:

gh pr view <PR> --json number,title,body,author,state,baseRefName,headRefName,url,labels,milestone,additions,deletions,changedFiles,createdAt,updatedAt,mergedAt,reviewDecision,reviews,assignees

Step 2: Gather the diff

Get the full diff of the PR:

gh pr diff <PR>

If the diff is very large (>3000 lines), focus on the most important files first and summarize the rest.

Step 3: Collect PR discussion context

Fetch all comments and review threads:

gh api repos/{owner}/{repo}/pulls/{number}/comments --paginate
gh api repos/{owner}/{repo}/issues/{number}/comments --paginate
gh api repos/{owner}/{repo}/pulls/{number}/reviews --paginate

Pay attention to:

  • Reviewer feedback and requested changes
  • Author responses and explanations
  • Any unresolved conversations
  • Approval or rejection status

Step 4: Find and read linked issues

Look for issue references in:

  • The PR body (patterns like #123, fixes #123, closes #123, resolves #123)
  • The PR branch name (patterns like issue-123, fix/123)
  • Commit messages

For each linked issue, fetch its content:

gh issue view <number> --json title,body,comments,labels,state

Read through issue comments to understand the original problem, user reports, and any discussed solutions.

Step 5: Analyze and validate

With all context gathered, analyze the PR critically:

  1. Intent alignment: Does the code change actually solve the problem described in the PR and/or linked issues?
  2. Completeness: Are there aspects of the issue or requested feature that the PR doesn't address?
  3. Scope: Does the PR include changes unrelated to the stated goal? Are there unnecessary modifications?
  4. Correctness: Based on the diff, are there obvious bugs, edge cases, or logic errors?
  5. Testing: Does the PR include tests? Are they meaningful and do they cover the important cases?
  6. Breaking changes: Could this PR break existing functionality or APIs?
  7. Unresolved feedback: Are there reviewer comments that haven't been addressed?

Read the full file on GitHub · 119 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. 2mo ago First seen · 119 lines · 0 tokens per session scan A 2203ee8d472b

Subscribe to this mod's changes

review-pr is a command published in the GitHub repository modelcontextprotocol/python-sdk (24,708 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 908 tokens. 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.