propcom: a tiny script for AI code review workflows
Update (Jan 2026): The script now also captures review-level comments (not just inline comments), which tools like CodeRabbit and Unblocked use for summary feedback. The GraphQL query and output format have been updated accordingly.
When working with AI code review tools like Unblocked, I found myself in a repetitive loop: open GitHub, find the PR, scroll through comments, read the feedback, context-switch back to my editor. Rinse and repeat for every review cycle.
So I had Opus 4.5 write propcom (short for "PR open comments") โ a ~110-line bash script that fetches all unresolved review comments for the current branch and dumps them to the terminal. Since I use an AI-powered IDE with an integrated terminal, my coding assistant can read the output directly โ no copy-paste needed.
The problem
AI code reviewers like Unblocked post inline comments directly on your pull requests. These comments are valuable โ they catch bugs, suggest improvements, and learn your team's conventions over time. But the feedback loop has friction:
- You push code (I use Graphite for stacked PRs, so
gt submit) - The AI reviews it and posts comments
- You context-switch to GitHub/Graphite to read them
- You mentally map each comment back to your local code
- You make fixes
- Repeat
The context switch kills flow (and BOY do I hate that). And if you're using an AI coding assistant in your editor, you're now juggling two AI tools that don't talk to each other.
The solution
propcom bridges this gap. Run it from any branch with an open PR:
$ propcom
๐ PR #42: Add user authentication
๐ https://github.com/myorg/myrepo/pull/42
๐ Inline comments: 3 unresolved / 5 total
๐ Review-level comments: 1
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ src/auth/login.ts:47
๐ค unblocked-bot
Consider adding rate limiting here. Without it, this endpoint
is vulnerable to brute force attacks.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ src/auth/session.ts:23
๐ค unblocked-bot
The session token should be regenerated after authentication
to prevent session fixation attacks.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Now I just tell my AI coding assistant: "run propcom and address the review comments" โ and it executes the command, reads the output directly from the terminal, and has all the context it needs: file paths, line numbers, and the actual feedback.
How it works
The script is straightforward:
- Detect the repo โ parse the GitHub owner/repo from
git remote get-url origin - Find the PR โ use
gh pr listto find a PR for the current branch - Fetch comments โ query GitHub's GraphQL API for review threads
- Filter and format โ show only unresolved comments with file/line info
Here's the core GraphQL query:
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
title
url
reviewThreads(first: 100) {
nodes {
isResolved
comments(first: 1) {
nodes { author { login } body path line }
}
}
}
reviews(first: 100) {
nodes {
author { login }
state
body
createdAt
}
}
}
}
}
The script requires only gh (GitHub CLI) and jq โ tools most developers already have installed.
You can find the full script on GitHub Gist.
Installation
Save the script somewhere in your $PATH and make it executable:
curl -o ~/.local/bin/propcom https://gist.githubusercontent.com/ichoosetoaccept/e7820ed73e0af904eca3508490f4b4a5/raw/pr-open-comments
chmod +x ~/.local/bin/propcom
Or if you prefer an alias:
alias propcom='pr-open-comments'
Why this matters
The best developer tools reduce friction between thinking and doing. AI code review is powerful, but only if the feedback actually reaches you in a usable form.
propcom is tiny โ about 110 lines of bash โ but it closes the loop between AI reviewers and AI assistants. Push code with gt submit, get reviewed, tell your AI assistant to run propcom and fix the issues, amend with gt modify, repeat. No browser tabs, no context switching.
Sometimes the best tools are the ones you come up with yourself, one way or another.