Skip to content
CI/CD & Automation Intermediate

@claude GitHub Trigger

Trigger Claude Code reviews by mentioning @claude in PR comments via GitHub Actions

Command

"color:#9CA3AF;font-style:italic"># .github/workflows/"color:#7C5CFC">claude.yml
$ name: Claude Code
  on:
    issue_comment:
      types: [created]
    pull_request_review_comment:
      types: [created]
  jobs:
    "color:#7C5CFC">claude:
      "color:#7C5CFC">if: contains(github.event.comment.body, '@"color:#7C5CFC">claude')
      runs-on: ubuntu-latest
      permissions:
        contents: read
        pull-requests: write
        issues: write
      steps:
        - uses: anthropics/"color:#7C5CFC">claude-code-action@v1
          with:
            anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

Response

# In any PR comment, type:
# "@claude review this PR for security issues"
# "@claude explain the changes in src/auth.ts"
# "@claude suggest tests for this new endpoint"
#
# Claude responds as a PR comment with full context

Parsing Code

059669">">// The action handles everything — no parsing code needed.
059669">">// Key configuration options:
059669">">//   anthropic_api_key: Required API key
059669">">//   model: Default claude-sonnet-4-6 (cheaper 059669">">for reviews)
059669">">//   max_turns: Limit agentic turns (default 10)
059669">">//   allowed_tools: Restrict tool access 059669">">in CI
//   custom_instructions: Add project-specific review rules

Gotchas

! Filter for @claude in the comment body (the if: condition) to avoid running on every comment
! The action uses claude-sonnet-4-6 by default — set model: claude-opus-4-6 for complex reviews
! Requires ANTHROPIC_API_KEY in repository secrets — never commit API keys

Related Recipes

ci-review-prci-lint-commit Append System Prompt