Skip to content

Clarify Claude PR review prompt and fix head checkout#5364

Open
DracoLi wants to merge 1 commit into
masterfrom
dl/claude-prompt-improvement
Open

Clarify Claude PR review prompt and fix head checkout#5364
DracoLi wants to merge 1 commit into
masterfrom
dl/claude-prompt-improvement

Conversation

@DracoLi
Copy link
Copy Markdown
Contributor

@DracoLi DracoLi commented May 10, 2026

Why this should be merged

  • Moved workflow related prompt instructions to the workflow file instead of the agent prompt file.
  • Added some instruction in the workflow that should help the LLM to review the PR and make inline comments correctly.
  • Increase max turns to 50 because the previous value of 10 is not enough even on smaller PRs (example).
  • Ensure actions/checkout@v5 is checking out the PR head commit instead of master, which is the case when using pull_request_target.

How this works

  • actions/checkout now uses github.event.pull_request.head.sha so the job sees the PR head, not the base branch.
  • The inline prompt tells the agent to use gh pr view / gh pr diff, local Read/Grep/Glob/LS, and create_inline_comment; max-turns is raised from 10 to 50.
  • agents/pr-review.md drops duplicated checkout/inline wording now covered by the workflow prompt. Workflow now includes only the workflow related agent prompts.

How this was tested

Cannot be tested until this is merged.

Need to be documented in RELEASES.md?

No.

@DracoLi DracoLi force-pushed the dl/claude-prompt-improvement branch from b08226b to a54765d Compare May 10, 2026 18:03
@DracoLi DracoLi marked this pull request as ready for review May 11, 2026 13:05
@DracoLi DracoLi requested a review from a team as a code owner May 11, 2026 13:05
Copilot AI review requested due to automatic review settings May 11, 2026 13:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Claude PR-review workflow/prompting so the reviewer agent operates on the PR head commit (not the base branch when triggered via pull_request_target) and consolidates inline-comment guidance into the workflow.

Changes:

  • Update actions/checkout@v5 to checkout github.event.pull_request.head.sha so the job sees the PR’s head commit under pull_request_target.
  • Move/expand “how to review + how to comment” instructions into the workflow prompt and raise Claude max turns from 10 to 50.
  • Remove duplicated “checked out” / inline-comment wording from agents/pr-review.md now covered by the workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
agents/pr-review.md Removes duplicated checkout/inline-comment guidance so policy lives in the workflow prompt.
.github/workflows/claude-review.yml Checks out PR head SHA and strengthens the embedded prompt + increases max turns / tool allowlist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/claude-review.yml
@DracoLi DracoLi moved this to In Progress 🏗️ in avalanchego May 11, 2026
@samliok samliok added the ai-review Trigger Claude Code Review CI on this PR label May 11, 2026
Copy link
Copy Markdown
Contributor

@samliok samliok left a comment

Choose a reason for hiding this comment

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

added the ai-label to the PR to see the output. Didn't know we already had claude reviews set up already.

Also what are max-turns?

Comment thread .github/workflows/claude-review.yml Outdated
@DracoLi
Copy link
Copy Markdown
Contributor Author

DracoLi commented May 11, 2026

@samliok

Also what are max-turns?

That's how many agentic turns/tool-use cycles Claude can take before stopping. Setting a max is to avoid Claude potentially getting into a cycle where its wasting a bunch of tokens overthinking. Things like reading a file, running a diff is a tool call/turn. This run maxed the 10 turns.

@DracoLi DracoLi force-pushed the dl/claude-prompt-improvement branch from a54765d to 673561b Compare May 11, 2026 15:10
@DracoLi DracoLi requested a review from PlatCore May 11, 2026 15:11
Comment thread .github/workflows/claude-review.yml
@DracoLi
Copy link
Copy Markdown
Contributor Author

DracoLi commented May 11, 2026

@JuanLeon1
yep, i've addressed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger Claude Code Review CI on this PR

Projects

Status: In Progress 🏗️

Development

Successfully merging this pull request may close these issues.

4 participants