Steer PR review to the search tools, not shell grep#29
Merged
Conversation
The review allow-list permits bash only for git log/diff/show, but Sonnet 5 still reaches for `grep -rn`, `find`, `cat`, and `python` when verifying a finding across files. Each is denied and costs a turn plus a retry. On a repo with a tight max_turns the waste is enough to exhaust the budget mid-review on even a 4-file PR — the run dies with error_max_turns and posts no review at all. Tell the model up front that bash is git-only and to search and read with the Read/Grep/Glob tools, reviewing primarily from the diff and opening extra files only when a finding needs cross-file confirmation. Removes the denial class and curbs over-exploration without raising any cap. Follow-up to 8fe29fd.
dec0468 to
01343f1
Compare
jaysonv0341
approved these changes
Jul 6, 2026
jaysonv0341
left a comment
Contributor
There was a problem hiding this comment.
Hopefully this helps reduce the number of turns. LGTM
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The review allow-list permits bash only for
git log/git diff/git show, but Sonnet 5 still reaches forgrep -rn,find,cat, andpythonwhen verifying a finding across files. Each of those is denied and costs a turn plus a retry. On a repo with a tightmax_turnsthe waste is enough to exhaust the budget mid-review on even a 4-file PR — the run dies witherror_max_turnsand posts no review at all.Tell the model up front that bash is git-only and to search and read with the Read/Grep/Glob tools, reviewing primarily from the diff and opening extra files only when a finding needs cross-file confirmation. Removes the denial class and curbs over-exploration without raising any cap. Follow-up to 8fe29fd.
Evidence: reproducing a failing 4-file ht-crm review (
max_turns: 20) with the same restricted tool-set showed Sonnet 5 making exactly 3 non-git shell attempts (grep -rn --include, afind, andgrep -n) — matching that run'spermission_denials_count: 3. The review content itself was trivially small (a clean LGTM), so the budget was lost to denied-shell retries, not review volume.Ticket
N/A — ad hoc infra fix, not tied to a ticket.
Type of Change
Testing Done
Changes only the shared review workflow's prompt (no functional or schema change). Validated by reproducing the ht-crm review locally with the restricted tool-set: without steering, Sonnet 5 spends turns on denied shell
grep/find/pythoncalls; the added guidance directs it to the Read/Grep/Glob tools instead. Will confirm on live PR reviews across repos by watching turn and denial counts.Checklist