A Chrome extension that adds a "Copy Diff" button to GitHub Pull Requests, allowing you to instantly copy the PR diff in markdown format - perfect for AI code reviews and documentation.
- One-Click Copy: Adds a seamless "Copy Diff" button next to the "Review changes" button on GitHub PRs
- AI-Ready Format: Exports diffs in markdown format, optimized for AI code review tools like ChatGPT, Claude, or Copilot
- Customizable Prompts: Configure your own system prompt to guide AI reviews (e.g., focus on security, performance, or specific coding standards)
- Smart Integration: Automatically fetches PR metadata (title, repository, PR number) along with the diff
- No API Keys Required: Works directly with GitHub's interface - no authentication needed
Coming soon!
-
Download the extension
git clone https://github.com/jordanmiguel/get-pr-diff.git cd get-pr-diff
-
Install in Chrome
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
get-pr-diff
folder
- Open Chrome and go to
- Navigate to any GitHub Pull Request
- Click on the "Files changed" tab
- Find the "Copy Diff" button (appears left of "Review changes")
- Click to copy - The entire PR diff is now in your clipboard in markdown format
- Paste into your favorite AI tool for instant code review
- Click the extension icon in your Chrome toolbar
- Edit the default prompt to match your review needs
- Click "Save Settings"
Default prompt includes:
- Focus areas: bugs, security, performance, code quality
- Response format with file-specific feedback
- Guidelines for constructive reviews
Security-Focused:
You're a security expert reviewing code for vulnerabilities.
Focus on: SQL injection, XSS, authentication issues, data exposure...
Performance Review:
Analyze this PR for performance implications.
Look for: N+1 queries, unnecessary loops, memory leaks...
The extension copies PR information in this structure:
[Your configured system prompt]
# Pull Request: [PR Title]
**Repository:** owner/repo
**PR Number:** #123
**URL:** https://github.com/owner/repo/pull/123
## Diff
```diff
[Full PR diff with + and - indicators]
- Content Script: Injects the button and handles diff fetching
- Background Script: Manages CORS-free network requests
- Popup: Settings interface for prompt customization
- Storage: Chrome sync storage for settings persistence
activeTab
: Access to current GitHub tabclipboardWrite
: Copy formatted diff to clipboardstorage
: Save user preferences- Host permissions for
github.com
andpatch-diff.githubusercontent.com
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- The button only appears on the "Files changed" tab
- Large diffs (>10MB) may take a moment to copy
- Some GitHub Enterprise instances may require additional configuration
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the need for better AI-assisted code reviews
- Built for developers who love efficient workflows
- Special thanks to all contributors and users
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ for developers who value their time