Skip to content

Claude review cost - #520

Merged
laffer1 merged 2 commits into
masterfrom
claude-review-cost
Sep 25, 2026
Merged

laffer1 merged 2 commits into
masterfrom
claude-review-cost

Conversation

@laffer1

@laffer1 laffer1 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

cuts down on cost

AI-Assisted-by: Claude opus 5.5

Summary by Sourcery

Enhancements:

  • Reduce redundant Claude review work by canceling outdated reviews when new commits are pushed and allowing read-only Git inspection tools without repeated access denials.

laffer1 and others added 2 commits September 24, 2026 14:40
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>
@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Reduces 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

Change Details Files
Cancel superseded Claude reviews and grant the reviewer narrowly scoped read-only Git commands.
  • Group workflow runs by pull request or issue number and cancel in-progress runs when a newer event arrives.
  • Allow Claude to invoke Git diff, log, show, and blame commands through the configured tool whitelist.
.github/workflows/claude-review.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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:*)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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:*)"

@laffer1
laffer1 merged commit 5c95f91 into master Sep 25, 2026
5 of 11 checks passed
@laffer1
laffer1 deleted the claude-review-cost branch September 25, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant