From 01c0996f891883513349442f2514d574546a5d15 Mon Sep 17 00:00:00 2001 From: Marcelo Gobetti Date: Wed, 8 Jul 2026 22:28:35 -0300 Subject: [PATCH] Allow jq and ls in review, steer JSON queries to jq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviews of JSON-heavy repos (survey/connection-flow definitions) kept reaching for `python -c "import json; ..."` to parse and query deeply nested files. python is denied — it is arbitrary code execution, against this review's read-only contract — so each attempt cost a turn plus a retry, and with python blocked the model fell back to many granular cat/grep calls, inflating turn usage on exactly the files that need structural queries. jq is the right tool for that need: a read-only JSON query language that cannot execute code, so it fits the contract. Add it (and `ls`) to the allow-list, list both in the environment note, and tell the model to use jq for JSON and that python/node are unavailable so it stops probing for them. python stays denied. --- .github/workflows/claude-review.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index ec97a17..487a650 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -63,9 +63,11 @@ 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`) are available. It cannot run builds, linters, or test suites, - install dependencies, edit files, or reach the network — so do not - attempt repo setup, linting, or test commands. Review primarily from the + `wc`, `ls`, `jq`) are available. Use `jq` to inspect or query JSON (it is + read-only) — `python`, `node`, and other interpreters are NOT available. + It cannot run builds, linters, or test suites, install dependencies, edit + files, or reach the network — so do not attempt repo setup, linting, or + test commands. Review primarily from the diff (`git diff origin/...HEAD`), opening additional files only when a finding needs cross-file confirmation. If something genuinely requires a disallowed tool, note it once in the final comment instead of retrying. @@ -174,5 +176,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:*)'" + 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:*)'" track_progress: true