Greptile Review
Fetch Greptile review comments from the current PR and address them with judgement.
Usage
/greptile- Fetch comments for current branch's PR/greptile 597- Fetch comments for a specific PR
Steps
1. Detect PR
# If no argument, detect from current branch
gh pr list --head "$(git branch --show-current)" --json number,url -q '.[0]'
If no PR found, tell the user and stop.
2. Fetch Greptile comments
REPO="$(gh repo view --json nameWithOwner -q '.nameWithOwner')"
PR_NUMBER="${1:-$(gh pr list --head "$(git branch --show-current)" --json number -q '.[0].number')}"
# Inline comments (most actionable)
gh api "repos/${REPO}/pulls/${PR_NUMBER}/comments" --paginate \
| jq -s '[.[][] | select(.user.login == "greptile-apps[bot]") | {id, path, line, body, html_url}]'
# Review summary (fallback if no inline comments)
gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
| jq '[.[] | select(.user.login == "greptile-apps[bot]") | {id, state, body}]'
3. Grade and present findings
For each comment, read the actual code and CLAUDE.md conventions, then assign your own grade A-F with a score out of 100. Do NOT parrot Greptile's severity markers (P1/P2/etc.) — apply independent judgement.
Grading scale:
- A (90-100) — Real bug, security issue, or will break at runtime. Fix this.
- B (75-89) — Legitimate improvement, meaningful code quality gain.
- C (50-74) — Valid point but low impact. Fix if convenient.
- D (25-49) — Overly cautious or stylistic preference that doesn't match project conventions.
- F (0-24) — Pedantic, wrong, or conflicts with project patterns. Ignore.
Display each comment in a numbered list with grade and score:
1. B 78 files/zsh/sandbox.zsh:27 — ~/.claude mount only applied to new VMs
2. F 15 files/zsh/sandbox.zsh:10 — sed pattern edge case already guarded
If no Greptile comments found, say so and stop.
4. User decides
Ask the user which comments to address. Accept:
all— address every comment1, 3— specific numbersskip— done, don't fix anything- Or freeform like "fix the first one, ignore the nitpick"
5. Apply fixes with judgement
For each selected comment:
- Read the file and surrounding code
- Evaluate whether Greptile's suggestion is correct and appropriate
- If valid: apply the fix
- If disagree: explain why and skip it (e.g., "Greptile suggests X but this is intentional because Y")
- Show what was changed
Do NOT blindly apply suggestions. Use the project's CLAUDE.md conventions and your own judgement. Greptile can be wrong, overly pedantic, or suggest changes that conflict with project patterns.
6. Summary
After addressing comments, show a summary:
Fixed: 1, 2
Skipped: 3 (nitpick, not worth the churn)