You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Claude has reviewed this PR — expand after forming your own opinion
Summary
Reworks the Claude PR-review workflow to produce a single structured comment_body and post/update one sticky comment via a manual shell step, and adds a small JS helper (exp-stick-structured.js).
Findings
Workflow (.github/workflows/claude-review.yml)
Comment lookup is unpaginated (likely duplicate comments). The sticky-comment search
gh api repos/$REPO/issues/$PR/comments --jq '...'
fetches only the first page (default 30 comments). On a PR with more than 30 comments, the existing <!-- claude-review --> comment won't be found, so a new comment is created on every push instead of updating in place — defeating the "single sticky comment" goal. Add --paginate to the gh api call.
Prompt-injection surface changed. The previous config used include_comments_by_actor: "mmiermans" to keep untrusted comments out of context. The new prompt feeds the raw PR diff (gh pr diff) — author-controlled, untrusted content — to the model. Blast radius is limited (only Bash(gh pr diff:*) is allowed and output is constrained to comment_body), so worst case is manipulated review text rather than code execution. Worth a comment noting this is an accepted, bounded risk.
issues: write looks redundant.pull-requests: write already covers creating/editing issue comments on a PR. Harmless, but minor over-grant — consider dropping it.
Good: passing structured_output through an env var (SO) rather than inline ${{ }} interpolation into the shell avoids shell-injection from the model output; the structured_output != '' guard and --json-schema constraint are nice.
Division-by-zero / dead code.pct(part, total) returns Infinity/NaN when total === 0 — the inline comment even flags the missing guard. The function is also unused, declared as a global (no module export), and named like an experiment (exp-stick-...). This looks like debugging/experiment leftover that probably shouldn't be merged. If it's intentional, add the guard (return total === 0 ? 0 : (part / total) * 100;) and wire it in / export it.
Style (non-blocking)
The workflow's explanatory comments were stripped (e.g. the notes on cancel-in-progress, fork-PR guard, and tool allowlist rationale). They were useful context for future maintainers; consider keeping a few.
Verdict
No critical bugs, but two things to address before merge: the unpaginated comment lookup (functional regression risk) and the exp-stick-structured.js experiment file (dead code + div-by-zero). The injection-surface change is acceptable given the tool/output constraints but worth acknowledging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sticky-review strategy test. Do not merge.