gh-pr-comments
A GitHub CLI extension for structured access to Pull Request reviews and review comments.
Usage
Claude Code automatically installation
Just copy this instruction to claude code and then use /gh-pr-comments:address-comments slash command:
Follow https://github.com/STRRL/gh-pr-comments/blob/master/README.md, install or update to the latest version of:
- gh extension STRRL/gh-pr-comments
- claude code plugin gh-pr-comments from marketplace STRRL/gh-pr-comments
Then tell user about usage of `/gh-pr-comments:address-comments`
Manually installation
# Step 1: Install or upgrade the gh extension
gh extension install STRRL/gh-pr-comments --force
# Step 2: Add the marketplace
claude plugin marketplace add STRRL/gh-pr-comments
# Step 3: Install the plugin
claude plugin install gh-pr-comments
Updating to Latest Version
# Update the gh extension
gh extension install STRRL/gh-pr-comments --force
# Update the Claude Code plugin
claude plugin marketplace update gh-pr-comments
Use the /gh-pr-comments:address-comments slash command to:
- List all unresolved PR comments
- Get AI analysis and suggested fixes for each comment
- Choose how to handle each comment - The AI will always ask for your decision using
AskUserQuestion before making any changes
- Apply fixes with your confirmation
- Mark comments as resolved
Note: The plugin always uses AskUserQuestion to get your explicit approval before taking any action. You maintain full control over what changes are made and how comments are resolved.
The plugin also includes a skill that automatically activates when you discuss PR reviews or code review feedback.
Problem
The gh CLI doesn't provide structured access to PR review comments:
# These don't exist or are limited in gh CLI:
gh pr review list # Can't list all reviews with states
gh pr comments --by-review # Can't group comments by review
gh pr comments --unresolved # Can't filter unresolved comments
gh pr comments --outdated # Can't filter outdated comments
Solution
gh pr-comments fills this gap by providing structured access to:
- Pull Request Reviews - List all reviews with their states (APPROVED, CHANGES_REQUESTED, COMMENTED, etc.)
- Review Comments - List inline code comments, optionally filtered by review
- Filtering - Filter by outdated status, resolved status (resolved hidden by default)
- Hierarchical View - See the tree structure of reviews and their comments
Usage
All commands support automatic PR detection - if no PR reference is given, the extension finds the PR for the current branch.
List Reviews
List all reviews on a pull request:
gh pr-comments reviews # auto-detect PR for current branch
gh pr-comments reviews https://github.com/owner/repo/pull/123
gh pr-comments reviews owner/repo/123
gh pr-comments reviews 123 # in a repo context
Output:
ID STATE AUTHOR SUBMITTED
3581523351 COMMENTED copilot[bot] 2025-12-16
3581000000 APPROVED reviewer 2025-12-15
3580000000 CHANGES_REQUESTED another-reviewer 2025-12-14
List Review Comments
List all review comments on a pull request (resolved comments hidden by default):
gh pr-comments list # auto-detect PR for current branch
gh pr-comments list https://github.com/owner/repo/pull/123
Output:
ID FILE LINE OUTDATED RESOLVED REVIEW ID AUTHOR BODY
2621968472 pkg/deviceflow/store.go 109 true false 3581523351 copilot Setting the status...
2621968513 cmd/wonder/worker.go 258 false false 3581523351 copilot Network or decoding...
Show all comments including resolved:
gh pr-comments list --all # show all comments
gh pr-comments list --resolved=true # only resolved comments
gh pr-comments list --resolved=false # only unresolved (default behavior)
Filter by review:
gh pr-comments list owner/repo/123 --review-id=3581523351
Filter outdated comments:
gh pr-comments list owner/repo/123 --outdated
gh pr-comments list owner/repo/123 --outdated=false # only current comments
View Full Content
View the full content of any item (auto-detects whether it's a review comment, review, or issue comment):
gh pr-comments view 2621968472 # view any item by ID
gh pr-comments show 3581523351 # 'show' is an alias for 'view'
gh pr-comments view 2621968472 --json # output as JSON