Uses GitHub's GraphQL API to fetch only the unresolved review-thread comments from a pull request, grouped by file.
When to Use
- You need only the unresolved review comments from a PR.
- You want to filter out feedback that has already been resolved.
Instructions
-
Get the PR URL:
- First check for environment variables: if
PR_NUMBERandGITHUB_REPOSITORYare set, construct the URL ashttps://github.com/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}. - Otherwise, use
gh pr view --json url -q '.url'to get the current branch's PR URL.
- First check for environment variables: if
-
Run the skill:
uv run "${CLAUDE_SKILL_DIR}/scripts/fetch_unresolved_comments.py" <pr_url>Example:
uv run "${CLAUDE_SKILL_DIR}/scripts/fetch_unresolved_comments.py" https://github.com/owner/repo/pull/123The script is a self-contained PEP 723 script —
uv runresolves its dependencies on demand. The GitHub token is auto-detected from theGH_TOKENenvironment variable orgh auth token.
Example Output
{
"total": 3,
"by_file": {
".github/workflows/resolve.yml": [
{
"thread_id": "PRRT_kwDOAL...",
"line": 40,
"startLine": null,
"diffHunk": "@@ -0,0 +1,245 @@\n+name: resolve...",
"comments": [
{
"id": 2437935275,
"body": "We can remove this once we get the key.",
"author": "reviewer-a",
"createdAt": "2026-05-17T00:53:20Z"
},
{
"id": 2437935276,
"body": "Good catch, I'll update it.",
"author": "contributor",
"createdAt": "2026-05-17T01:10:15Z"
}
]
}
],
".gitignore": [
{
"thread_id": "PRRT_kwDOAL...",
"line": 133,
"startLine": null,
"diffHunk": "@@ -130,0 +133,2 @@\n+.claude/*",
"comments": [
{
"id": 2437935280,
"body": "Should we add this to .gitignore?",
"author": "reviewer-b",
"createdAt": "2026-05-17T01:15:42Z"
}
]
}
]
}
}