Fetch, analyze, and respond to PR review comments. Use when asked to check PR comments, address review feedback, respond to reviewers, or fix issues raised in code reviews.
Systematically triage, address, and respond to every review comment on a pull request. No comment should be silently skipped.
Every review comment gets an explicit disposition. A comment is either:
Never silently skip a comment. Never dismiss a comment just because it is non-blocking, a suggestion, or an improvement rather than a bug. CodeRabbit is configured with project-specific rules ā its feedback reflects project standards and should be treated with the same rigor as human review comments.
If not provided, detect from current branch:
gh pr view --json number -q .number
Fetch both issue-level comments and inline review threads:
# Inline review comments
gh api repos/{owner}/{repo}/pulls/{pr}/comments
# Issue-level comments (summaries, top-level feedback)
gh api repos/{owner}/{repo}/issues/{pr}/comments
# Review thread resolution status
gh api graphql -f query='
query {
repository(owner: "{owner}", name: "{repo}") {
pullRequest(number: {pr}) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 10) {
nodes {
author { login }
body
path
line
createdAt
updatedAt
}
}
}
}
}
}
}'
Compare createdAt vs updatedAt on each comment. If a comment was updated after a previous response, it means the reviewer edited their feedback ā treat it as new input that needs re-evaluation.
Also check for reply chains: if a reviewer responded to your previous reply, that thread needs attention regardless of resolution status.
For EVERY unresolved comment (and resolved comments with new replies), create a triage entry:
| # | Source | File:Line | Issue Summary | Disposition | Action |
|---|
Fill in Source (coderabbitai[bot], human username), the file and line, a one-sentence summary of the issue, and leave Disposition/Action blank.
Present this table to the user and ask for confirmation before proceeding. The user may override dispositions or skip specific comments.
For each comment, read the relevant code and determine the disposition:
Do not use weasel language like "just a suggestion", "non-blocking", or "nice to have" to skip valid feedback. If the feedback identifies a real issue (bug, regression, accessibility problem, spec violation), it should be accepted regardless of how the reviewer labeled its severity.
For each accepted comment:
For each non-accepted comment, reply to the thread with:
All responses MUST end with the agent signature:
š¤ _Response by [Claude Code](https://claude.com/claude-code)_
Write the response to a temp file first (to avoid heredoc issues), then post:
mkdir -p /tmp/claude
printf '%s\n' \
'[response body]' \
'' \
'š¤ _Response by [Claude Code](https://claude.com/claude-code)_' \
> /tmp/claude/pr-comment.md
gh api graphql -f query='
mutation($body: String!) {
addPullRequestReviewThreadReply(input: {
pullRequestReviewThreadId: "{thread_id}"
body: $body
}) {
comment { id }
}
}' -f body="$(cat /tmp/claude/pr-comment.md)"
rm /tmp/claude/pr-comment.md
Only resolve threads where the disposition is Accept (code was fixed) or Dispute (with explanation posted). Do NOT resolve Acknowledged threads ā those stay open as a reminder for follow-up.
gh api graphql -f query='
mutation {
resolveReviewThread(input: { threadId: "{thread_id}" }) {
thread { isResolved }
}
}'
Commit all fixes with a message referencing the review feedback, then push.
After all comments are handled, present the completed triage table with final dispositions:
| # | Source | File:Line | Issue Summary | Disposition | Response |
|---|
This gives the user a clear audit trail of what was done with every comment.
User says: "Check the PR comments" Action: Fetch all comments, build triage table, present for review, then address each systematically
User says: "Address the review feedback on PR 42" Action: Fetch comments for PR #42, triage all, fix accepted issues, respond to all threads, report status
User says: "Any new review comments?" Action: Fetch comments, check for updated/new comments since last response, triage only the new ones