gh-get-review-comments

Retrieve all review comments from a pull request using the GitHub API. Use when you need to see what feedback has been provided on a PR.

⭐8stars🔀4forks📁View on GitHub🕐Updated Jan 3, 2026

When & Why to Use This Skill

This Claude skill streamlines the software development lifecycle by programmatically retrieving all review comments from GitHub pull requests. It empowers developers to efficiently analyze feedback, track unresolved issues, and organize PR revisions, significantly reducing the manual effort required during the code review phase and improving overall code quality.

Use Cases

  • Audit Unresolved Feedback: Automatically list all top-level comments to ensure no reviewer suggestions are missed before a pull request is merged.
  • Targeted Review Analysis: Filter comments by specific files or reviewers to focus on critical code paths or address feedback from lead engineers first.
  • Fix Planning & Automation: Extract comment IDs and bodies to programmatically generate a checklist of required changes, facilitating a structured approach to PR updates.
  • Code Review Summarization: Aggregate all PR feedback into a concise summary to provide project managers or team leads with an overview of the review status.
namegh-get-review-comments
description"Retrieve all review comments from a pull request using the GitHub API. Use when you need to see what feedback has been provided on a PR."
categorygithub
agenttest-engineer
user-invocablefalse

Get PR Review Comments

Retrieve and analyze all review comments from a pull request.

When to Use

  • Checking for unresolved review feedback
  • Analyzing reviewer feedback before fixing
  • Verifying all comments have been addressed
  • Getting comment IDs for replies

Quick Reference

# Get all review comments
gh api repos/OWNER/REPO/pulls/PR/comments

# Get comments with formatting
gh api repos/OWNER/REPO/pulls/PR/comments \
  --jq '.[] | {id: .id, path: .path, body: .body}'

# Filter by reviewer
gh api repos/OWNER/REPO/pulls/PR/comments \
  --jq '.[] | select(.user.login == "username")'

# Get only unresolved comments
gh api repos/OWNER/REPO/pulls/PR/comments \
  --jq '.[] | select(.in_reply_to_id == null)'

Workflow

  1. Fetch comments: Use API to list all comments
  2. Parse output: Extract IDs and feedback
  3. Analyze feedback: Understand what needs fixing
  4. Plan fixes: Decide how to address each comment
  5. Apply fixes: Make the requested changes

Output Format

Comments include:

  • id - Comment ID (use for replies)
  • path - File where comment was made
  • line - Line number of comment
  • body - Comment text
  • user - Reviewer username
  • in_reply_to_id - Parent comment ID (null if top-level)

Error Handling

Problem Solution
PR not found Verify PR number
Auth failure Check gh auth status
No comments API returns empty array (not an error)
Permission denied Check authentication scopes

Filtering Examples

Comments on specific file:

gh api repos/OWNER/REPO/pulls/PR/comments \
  --jq '.[] | select(.path == "src/file.mojo")'

Comments by specific reviewer:

gh api repos/OWNER/REPO/pulls/PR/comments \
  --jq '.[] | select(.user.login == "reviewer")'

Only top-level comments (not replies):

gh api repos/OWNER/REPO/pulls/PR/comments \
  --jq '.[] | select(.in_reply_to_id == null)'

References