Claude auto PR review
Copied from the official Solutions Guide basic example (prompt shortened).
pull_request: opened, synchronize
Est. cost per run~$0.18Checked Oct 16, 2026
Not executedJust shippedOur pick for the best security, implementation, and planning skills.Best skills for each job.See the picks →
Sets a required status check that fails until a human approves any pull request containing agent-authored commits. It runs from the default branch, so a PR cannot edit the check to approve itself. Approvals are re-read on new pushes or an /approve comment.
pull_request_target: opened, synchronize, reopened, ready_for_review (re-checked on new PR replies)
How it works
Setup
.github/workflows/claude-code-action-agent-approval-check.ymlLet your agent do it
Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.
Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.
Do the job of the "Agent approval check: require human approval on PRs with agent-authored commits" workflow from AgentFlows (https://agentflows.sh/flows/claude-code-action-agent-approval-check) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action. What it does: Sets a required status check that fails until a human approves any pull request containing agent-authored commits. It runs from the default branch, so a PR cannot edit the check to approve itself. Approvals are re-read on new pushes or an /approve comment. The workflow normally runs on: pull_request_target: opened, synchronize, reopened, ready_for_review (re-checked on new PR replies). Instead, ask me which pull request, issue, or branch to work on, then follow these instructions: ```text Sets a required status check that fails until a human approves any pull request containing agent-authored commits. It runs from the default branch, so a PR cannot edit the check to approve itself. Approvals are re-read on new pushes or an /approve comment. ``` Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.
The file
Copy the file as-is. The notes beside each block explain it.
.github/workflows/claude-code-action-agent-approval-check.yml
File
The rest of the file, including the prompt the engine reads.
# Require human approvals on PRs that contain agent-authored commits.## Both triggers run the workflow file from the BASE/DEFAULT branch, so a PR# cannot edit this check to approve itself. (`pull_request_review` is not# used because it runs from the merge ref, not the default branch; native# Approve reviews are picked up on the next synchronize or `/approve`# comment.)## After adding this workflow, mark `agent-approval-check` as a required# status check on your protected branches.Name
The name GitHub shows in the Actions tab. The file path is under Where to paste this.
name: agent-approval-checkTrigger
GitHub starts a run when someone comments on an issue.
on: pull_request_target: types: [opened, synchronize, reopened, ready_for_review] issue_comment: types: [created]Permissions
This token may read the repo, comment on pull requests and open them, and statuses: write. Anything not listed is not granted.
permissions: contents: read pull-requests: write statuses: writeJobs
Each job is one runner. The steps inside it run top to bottom.
jobs: check: # issue_comment also fires on plain issues; skip those early. if: github.event_name != 'issue_comment' || github.event.issue.pull_request runs-on: ubuntu-latestSteps
These steps run in order on that job.
steps:Agent
Runs Claude Code with anthropics/claude-code-action/agent-approval-check@main. Inputs: required_approvals; agent_emails; agent_logins.
- uses: anthropics/claude-code-action/agent-approval-check@main with: required_approvals: 2 agent_emails: noreply@anthropic.com agent_logins: claude[bot],claude-code[bot] # Uncomment to tune: # excluded_approvers: dependabot[bot] # exempt_path_prefixes: docs/ # protected_bases: main,releaseKeep going
Copied from the official Solutions Guide basic example (prompt shortened).
pull_request: opened, synchronize
Est. cost per run~$0.18Checked Oct 16, 2026
Not executed`track_progress: true` posts a checkbox tracking comment (per Solutions Guide).
pull_request: opened, synchronize, ready_for_review, reopened
Est. cost per run~$0.22Checked Oct 16, 2026
Not executedNo `prompt` → the action runs in tag/interactive mode and responds to the comment. `trigger_phrase` default is `@claude` (usage.md).
issue_comment / pull_request_review_comment containing @claude
Est. cost per run~$0.27Checked Oct 16, 2026
Not executed· 1 caveat