Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/claude-pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Claude PR comment handler

# Respond to every human comment/review on a PR — no @claude mention needed.
# Runs on the Max subscription via CLAUDE_CODE_OAUTH_TOKEN (not API credits).
"on":
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]

# One run per PR; newer comments supersede an in-flight run.
concurrency:
group:
claude-pr-comment-${{ github.event.issue.number ||
github.event.pull_request.number }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write
issues: write
id-token: write

jobs:
respond:
# Only on PR-attached comments, with a non-empty body, and never from a bot
# (the loop guard: Claude's own replies are bot comments, so they can't
# re-trigger this workflow).
if: >
github.event.sender.type != 'Bot' && (
(github.event_name == 'issue_comment' && github.event.issue.pull_request
!= null)
|| github.event_name == 'pull_request_review_comment'
|| (github.event_name == 'pull_request_review' &&
github.event.review.body != '')
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# Belt-and-suspenders loop guard alongside the sender.type check above.
exclude_comments_by_actor: "etrobert-bot,github-actions[bot],claude[bot]"
prompt: |
A human just left a comment or review on this pull request. Read it
in the full context of the PR diff and the conversation so far, then
handle it:

- If it requests a change, or makes a suggestion you agree with,
implement it and push a commit to this PR's branch.
- If it asks a question, answer it as a reply.
- If it is purely informational (e.g. "thanks", "lgtm"), a brief
acknowledgement is enough — don't manufacture work.

Follow this repo's Conventional Comments convention (issue,
question, suggestion, nitpick). Always reply on the thread so the
author knows the comment was handled. Do NOT merge — a human reviews
and merges.
claude_args: |
--max-turns 20
Loading