Delete all comments from a GitHub PR (issue comments + review comments) — use for 'clear PR comments', 'delete PR comments', 'remove PR comments', 'clean PR comments'
Resources
1Install
npx skillscat add cuozg/oh-my-unity/git-clear Install via the SkillsCat registry.
SKILL.md
git-clear
Delete every comment on a GitHub Pull Request — both timeline (issue) comments and inline review comments. Uses gh api with pagination.
When to Use
- Clearing bot-generated or outdated review comments before a fresh review cycle
- Removing stale AI review comments after code changes
- Cleaning up a noisy PR thread before requesting re-review
- Bulk-removing comments left by automated tools
Workflow
- Identify — Determine the PR number. Run
gh pr viewor accept it from the user - Resolve — Extract
{owner}and{repo}fromgh repo view --json owner,name - List — Fetch all issue comments and review comments with
--paginate - Confirm — Show the comment count to the user and wait for explicit approval
- Delete — Run
clear_pr_comments.pyto delete all comments viagh api --method DELETE - Verify — Re-list both endpoints to confirm zero comments remain
Rules
- Always confirm with the user before deleting — show exact comment counts first
- Delete both issue comments (
/issues/comments/{id}) and review comments (/pulls/comments/{id}) - Handle pagination for PRs with many comments (
--paginateor?per_page=100) - Requires
reposcope ongh auth— verify withgh auth statusif deletions fail - Only delete comments you have permission to delete (own comments or repo write access)
- Never modify the PR description, title, or labels — comments only
Output Format
Summary of deleted comments: Deleted {n} issue comments and {m} review comments from PR #{pr}.
Scripts
scripts/clear_pr_comments.py— Delete all PR comments viagh api. Usage:python3 clear_pr_comments.py <owner> <repo> <pr_number>
Run scripts via run_skill_script("git-clear", "scripts/clear_pr_comments.py", ["owner", "repo", "42"]).