Claude review cost - #520
Conversation
The review workflow fires on every push to a PR and nothing cancelled the run already in progress for the previous head. Several PRs were reviewed two to four times on the same day, each a full run. Add a concurrency group keyed on the PR number so a new push cancels the stale review instead of paying for both. AI-Assisted-by: Claude Fable 5.1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lucas Holt <luke@foolishgames.com>
Every recent review run recorded three to six permission denials, each a wasted turn. The allowed tool list covered Glob, Grep, LS and Read but no way to see the diff or history, so allow git diff, log, show and blame. Verify by watching permission_denials_count in the next runs' result output; revert if it does not drop. AI-Assisted-by: Claude Fable 5.1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lucas Holt <luke@foolishgames.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReduces Claude review cost and wasted turns by cancelling obsolete workflow runs and explicitly permitting the read-only Git commands needed to inspect a pull request. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/claude-review.yml" line_range="40" />
<code_context>
trigger_phrase: "@claude"
+ # Read-only git access. Every recent run logged 3-6 denied tool
+ # calls, each a wasted turn; a reviewer needs the diff and history.
+ claude_args: "--allowedTools Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*)"
prompt: |
REPO: ${{ github.repository }}
</code_context>
<issue_to_address>
**issue (bug_risk):** The new `--allowedTools` argument replaces the action's existing default allowlist, so Claude is left with only the four `git` command patterns and loses `Glob`, `Grep`, `LS`, and `Read`; the reviewer cannot use the normal source-inspection tools it previously relied on.
**Triggers:** On any review run where the action treats the CLI allowlist as an override rather than a merge.
**Suggested fix:** Include the existing inspection tools in the allowlist, for example `Read,Glob,Grep,LS` alongside the four `Bash(git ...)` patterns, or use the action's documented additive mechanism.
```suggestion
claude_args: "--allowedTools Read,Glob,Grep,LS,Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*)"
```
</issue_to_address>| trigger_phrase: "@claude" | ||
| # Read-only git access. Every recent run logged 3-6 denied tool | ||
| # calls, each a wasted turn; a reviewer needs the diff and history. | ||
| claude_args: "--allowedTools Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*)" |
There was a problem hiding this comment.
issue (bug_risk): The new --allowedTools argument replaces the action's existing default allowlist, so Claude is left with only the four git command patterns and loses Glob, Grep, LS, and Read; the reviewer cannot use the normal source-inspection tools it previously relied on.
Triggers: On any review run where the action treats the CLI allowlist as an override rather than a merge.
Suggested fix: Include the existing inspection tools in the allowlist, for example Read,Glob,Grep,LS alongside the four Bash(git ...) patterns, or use the action's documented additive mechanism.
| claude_args: "--allowedTools Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*)" | |
| claude_args: "--allowedTools Read,Glob,Grep,LS,Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*)" |
cuts down on cost
AI-Assisted-by: Claude opus 5.5
Summary by Sourcery
Enhancements: