This guide walks you through extracting PR comments and using them with an AI assistant.
Step 1: Open a PR with Comments
Navigate to any pull request or merge request that has review comments. For this guide, any PR with at least one comment will work.
Step 2: Click the GitSniper Button
Look for the GitSniper button on the page. On GitHub, it appears in the PR header area. On GitLab, it's in the merge request actions.
Click the button once. You'll see:
- A brief loading animation
- A success notification
- The extracted comments are now in your clipboard
Step 3: Paste into Your AI Tool
Open your preferred AI assistant (Claude, ChatGPT, etc.) and paste the extracted content:
Here's the feedback from my code review:
[paste GitSniper output here]
Please help me address each comment.
The AI now has full context for every comment, including:
- The file and line numbers
- The diff showing what changed
- The reviewer's feedback
- Any threaded replies
Step 4: Implement the Feedback
The AI can work through each comment systematically. A typical response might be:
Comment 1 (@reviewer): "Add error handling for the async call"
I'll wrap the async call in a try-catch block:
typescript try { const token = await getTokenAsync(); } catch (error) { logger.error('Token fetch failed:', error); throw new AuthenticationError('Unable to retrieve token'); }
Customising the Output
Add a Preamble
Preambles are custom instructions prepended to the extracted comments. They help guide how the AI interprets the feedback.
- Click the GitSniper extension icon in your toolbar
- Enable Use Preamble
- Click Add New to create a preamble
- Enter a name (e.g., "Code Review Mode") and your instructions
Example preamble:
You are helping me address code review feedback.
For each comment:
1. Explain what the reviewer is asking for
2. Provide the code change needed
3. Note any potential edge cases
Our codebase uses TypeScript with strict mode enabled.
Exclude Authors
Filter out comments from specific authors (useful for bot comments or CI feedback):
- Open the GitSniper popup
- Scroll to Exclude Authors
- Enter the username to exclude (e.g.,
@dependabot) - Click Add
What's Next
- Learn about Smart Extraction for advanced context capture
- Set up Custom Preambles for your workflow
- Configure Author Filtering to reduce noise