anthropics / anthropics/claude-code-action

Claude PR reviews are influenced by other comments

Open
#260 5 comments 2 reactions 0 assignees View on GitHub
bug p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

We're using claude-code-action to do automatic PR reviews and can see that generated reviews are influenced by other comments, including comments from claude itself. For example

if someone left a comment saying that certain line won't work, claude will just assume that this is a valid comment without actually verifying this statement and claiming that this is a "well founded feedback that need to be addressed" causing confusion. not to mention, that comments at times may be excessive and off topic.

I _think_ the reason this is happening is that claude gets all PR details as prompt - [link](https://github.com/anthropics/claude-code-action/blob/main/src/create-prompt/index.ts#L513)

Attempts to add something along the lines `**Ignore all prior comments, discussions, or reviews**, even from yourself.` to the direct_prompt didn't work.

Im wondering if there is a way to work around that and make claude reviews truly independent?

Or, for example, i can look into making a PR to allow PR context customisation:

```
- name: review
uses: anthropics/claude-code-action@v0.0.32
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
timeout_minutes: '15'
use_sticky_comment: false
inject_context:
- pr_title
- pr_description
- comments
- review_comments
- ...
direct_prompt: Review this PR
```

Or, in fact, any other implementation we can agree on to solve this problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.