review-pr

A command for reviewing a GitHub pull request, which is a proposed code change submitted for approval. It fetches the change and posts the review findings back to GitHub.

In plain words
What is it for?
Use it to inspect a pull request's code changes and publish structured review comments or a summary on GitHub.
Why use it?
It puts code-review results where the pull request is discussed, instead of leaving them in a separate document or chat. It also accounts for states such as draft, closed, merged, unavailable, or incomplete changes.

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/oolab-labs/patchwork-os/review-pr
Clone the repo
git clone --depth 1 https://github.com/Oolab-labs/patchwork-os

Made for: Claude Code.

Per session 8 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,405 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00008 $0.01405
Opus 5 $0.00004 $0.00702
Sonnet 5 $0.00002 $0.00281
Haiku 4.5 $0.00001 $0.00140

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

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.

Origin

This is a copy

100% identical to review-pr — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/review-pr.md · 121 lines

How it starts

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

GitHub PR Code Review

Review pull request #$1 and post findings back to GitHub as a structured code review.

Repository (optional): $2

Step 1: Fetch the PR and Validate State

Call githubGetPRDiff with prNumber $1. If $2 is provided, pass it as repo.

If the tool returns an error, report it to the user and stop.

After fetching, check these conditions before proceeding:

  • Closed/merged PR: If state is CLOSED or MERGED, warn the user that the PR is no longer open and ask whether they still want a review. If proceeding, always use COMMENT event (never REQUEST_CHANGES on non-open PRs).
  • Draft PR: If isDraft is true, inform the user this is a draft PR and ask whether to proceed. The author may not be ready for review.
  • Diff unavailable: If the diff field starts with "(diff unavailable", inform the user the diff could not be fetched (typically because the head branch was deleted after merge). Stop — inline comments are not possible without a diff. Only a summary review based on metadata can be posted.
  • Truncated diff: If truncated is true, warn the user that the diff exceeds 256 KB and only a partial review is possible. Note in the review body that the analysis covers the first 256 KB only. Be cautious with inline comments near the end of the visible diff — line numbers may not map correctly.
  • Incomplete file list: If filesIncomplete is true, warn that not all changed files are listed (GitHub API pagination limit). The review will cover only the files visible in the diff.

Step 2: Assess Review Depth

Check the PR metadata to determine review scale:

  • Small (< 100 lines changed = additions + deletions): Single-pass review of the entire diff
  • Medium (100–500 lines): Review file-by-file, examining each changed file in sequence
  • Large (500+ lines): Launch up to 3 parallel Agent subagents, each reviewing a subset of the changed files. Combine their findings before proceeding.

For large PRs, split files into groups and give each agent the relevant portion of the diff with instructions to find bugs, security issues, error handling gaps, and performance concerns.

Read the full file on GitHub · 121 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 · 121 lines · 8 tokens per session scan A 3bfa1304ef7b

Subscribe to this mod's changes

review-pr is a command published in the GitHub repository Oolab-labs/patchwork-os (30 stars, last pushed 2d ago), licensed MIT. It adds 8 tokens to every session and 1,405 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to review-pr, differing in 0 lines, and is treated as a copy.