Skip to content

Commit 6da20ba

Browse files
Upgrade Claude Code review to Opus 4.7 with scoped tool permissions (#733)
## Summary - Upgrades the Claude Code review model from Opus 4.6 to Opus 4.7 - Scopes `allowedTools` patterns to the current PR number instead of wildcards. This prevents Claude from accidentally posting review comments on other PRs (e.g. previously merged PRs). - Adds an explicit prompt guardrail telling Claude to only interact with the current PR ## Context On aws-otel-js-instrumentation, a review run for PR #406 accidentally posted 10 review comments on the already-merged PR #391. The cause was the wildcard pattern in `allowedTools` (`repos/*/pulls/*`) allowing Claude to post to any PR. ## Test plan - [ ] Verify Claude still posts review comments on new PRs - [ ] Verify Claude cannot post to other PRs (by checking only current PR gets comments)
2 parents 9aa2903 + a2b25f5 commit 6da20ba

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ jobs:
3939

4040
- name: Run Claude Code Review
4141
id: claude-review
42-
uses: anthropics/claude-code-action@1b422b3517b51140e4484faab676c5e68b914866 #v1.0.73
42+
uses: anthropics/claude-code-action@0766301cba8671db92e3025984e2fd038ad48ff7 #v1.0.104
4343
with:
4444
use_bedrock: "true"
4545
direct_api: "true"
4646
github_token: ${{ secrets.GITHUB_TOKEN }}
4747
claude_args: |
48-
--model us.anthropic.claude-opus-4-6-v1 --allowedTools "Bash(gh pr diff *),Bash(gh pr view *),Bash(gh api repos/*/pulls/*/comments*),Bash(gh api repos/*/pulls/*/reviews*)"
48+
--model us.anthropic.claude-opus-4-7 --allowedTools "Bash(gh pr diff ${{ github.event.pull_request.number }}),Bash(gh pr view ${{ github.event.pull_request.number }}),Bash(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments*),Bash(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews*)"
4949
prompt: |
50-
Review this PR for bugs, security issues, and code quality. Post your findings as inline review comments on the relevant lines.
50+
Review PR #${{ github.event.pull_request.number }} in this repository for bugs, security issues, and code quality. Post your findings as inline review comments on the relevant lines of this PR only. Do not modify, comment on, or interact with any other PR.

0 commit comments

Comments
 (0)