fetch-diff
Fetch PR diff with filtering and line numbers for code review.
When & Why to Use This Skill
The fetch-diff skill is a specialized developer tool designed to streamline the code review process within Claude. It retrieves pull request diffs, intelligently filters out noisy auto-generated files, and appends precise line numbers to the output. This allows for more accurate analysis and easier placement of review comments, significantly improving the efficiency of technical audits and collaborative coding tasks.
Use Cases
- 1. Efficient Code Auditing: Quickly fetch and analyze GitHub pull request changes to identify potential bugs, logic flaws, or security vulnerabilities without manual context switching.
- 2. Noise Reduction in Reviews: Automatically exclude irrelevant files such as lockfiles or auto-generated assets to focus exclusively on meaningful code changes.
- 3. Precise Feedback Placement: Use the integrated line numbering to provide exact references for review comments, making feedback more actionable for developers.
- 4. Automated PR Summarization: Provide the filtered diff as context for Claude to generate concise summaries of changes for team leads and stakeholders.
| name | fetch-diff |
|---|---|
| description | Fetch PR diff with filtering and line numbers for code review. |
| - Bash(uv run skills fetch-diff | *) |
Fetch PR Diff
Fetches a pull request diff, filters out auto-generated files, and adds line numbers for easier review comment placement.
Usage
uv run skills fetch-diff <pr_url>
Example:
uv run skills fetch-diff https://github.com/mlflow/mlflow/pull/123
Token is auto-detected from GH_TOKEN env var or gh auth token.
Output Example
diff --git a/path/to/file.py b/path/to/file.py
index abc123..def456 100644
--- a/path/to/file.py
+++ b/path/to/file.py
@@ -10,7 +10,7 @@
10 10 | import os
11 11 | import sys
12 12 | from typing import Optional
13 | -from old_module import OldClass
14 | +from new_module import NewClass
14 15 |
15 16 | def process_data(input_file: str) -> dict: