From ab017d3831f27754bd0a8fa745eb3096a55ccab2 Mon Sep 17 00:00:00 2001 From: Marcelo Gobetti Date: Mon, 13 Jul 2026 20:39:53 -0300 Subject: [PATCH] Review repeated changes once instead of re-reading each copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the same change repeats across files (a migration applied to N modules, a field added to N definitions, a symbol renamed across callers), the review was re-reading every copy — on a 4-survey, ~9.5k-line ht-json migration it spent ~30 turns re-analyzing each giant file independently and tipped over max_turns. Add a short prompt step: review a repeated change once on one representative file, then confirm the other occurrences are identical (diff the per-file patch hunks against each other) rather than re-reading each, and focus the review on the distinct changes and on any file that deviates from the pattern (the highest-signal finding). This also catches uniformity problems, and applies to any repeat, not just large diffs. The step recommends `diff <(git diff …) <(git diff …)`, so add `diff` to the allow-list — it is read-only, like grep/jq/cat. --- .github/workflows/claude-review.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 0938bc3..d354eae 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -63,7 +63,7 @@ jobs: This review is read-only: the Read, Glob, and Grep tools plus read-only shell (`git log`/`git diff`/`git show`, `grep`, `cat`, `head`, `tail`, - `wc`, `ls`, `jq`) are available. Use `jq` to inspect or query JSON (it is + `wc`, `ls`, `jq`, `diff`) are available. Use `jq` to inspect or query JSON (it is read-only) — `python`, `node`, and other interpreters are NOT available. To locate or list files, use the Glob and LS tools (or `ls`) — `find` is NOT available. @@ -78,6 +78,17 @@ jobs: review guidelines. Apply it IN ADDITION to any repository-specific CLAUDE.md guidelines. + ## Repeated changes across files + + When the same change repeats across files (a migration applied to several + modules, a field added to many definitions, a symbol renamed across + callers), review it once on one representative file, then confirm the + other occurrences are identical rather than re-reading each — e.g. `diff + <(git diff origin/...HEAD -- fileA) <(git diff origin/...HEAD + -- fileB)`. Focus the review on the distinct changes and on any file that + does not match the pattern — a deviation from an otherwise-uniform change + is the highest-signal finding. + # Review rubric (Claude) ## Must-fix @@ -178,5 +189,5 @@ jobs: 5. Provide detailed feedback on code review ${{ inputs.extra_prompt }} - claude_args: "--model ${{ inputs.model }} --max-turns ${{ inputs.max_turns }} --allowedTools 'Read,Glob,Grep,LS,Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(grep:*),Bash(cat:*),Bash(head:*),Bash(tail:*),Bash(wc:*),Bash(jq:*),Bash(ls:*)'" + claude_args: "--model ${{ inputs.model }} --max-turns ${{ inputs.max_turns }} --allowedTools 'Read,Glob,Grep,LS,Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(grep:*),Bash(cat:*),Bash(head:*),Bash(tail:*),Bash(wc:*),Bash(jq:*),Bash(ls:*),Bash(diff:*)'" track_progress: true