Example workflows demonstrating how to integrate the Claude Code Assistant into your repository.
| Example | File | Description |
|---|---|---|
| Basic | basic-claude-assistant.yml |
Simple setup responding to @claude mentions |
| Code Review | code-review-assistant.yml |
Thorough code reviews on PRs |
| Security Review | security-review-assistant.yml |
Security-focused code analysis |
| Restricted | restricted-claude-assistant.yml |
Limited to specific users/teams |
| Multi-Trigger | multi-trigger-assistant.yml |
Different behaviors per trigger phrase |
# Basic assistant
cp github/workflows/examples/claude-code/basic-claude-assistant.yml .github/workflows/claude-code.ymlAdd the following secret to your repository:
| Secret | Description | Required |
|---|---|---|
CLAUDE_CODE_OAUTH_TOKEN |
Claude Code OAuth token from Anthropic | Yes |
To get your OAuth token:
- Visit console.anthropic.com
- Navigate to API Keys
- Create a new OAuth token for Claude Code
- Create a new issue with
@claudein the title or body - Comment
@claude help me understand this codeon any issue or PR - Request a code review with
@claude reviewon a pull request
@claude What does this function do?
@claude Help me fix this bug
@claude review Please review this PR for code quality and best practices
@claude security Check this PR for security vulnerabilities
The workflow supports configuration files in .github/config/claude-code/:
uses: bauer-group/automation-templates/.github/workflows/claude-code.yml@main
with:
config-file: 'code-review' # Uses .github/config/claude-code/code-review.ymlAvailable configurations:
default- General purpose assistancecode-review- Detailed code reviewssecurity-review- Security-focused analysisissue-helper- Issue triage and assistanceminimal- Quick, concise responses
Override settings directly in the workflow:
uses: bauer-group/automation-templates/.github/workflows/claude-code.yml@main
with:
model: 'opus'
trigger-phrase: '@claude'
analyze-diff: true
max-files-to-analyze: 50
timeout-minutes: 30The workflow requires these permissions:
permissions:
contents: read
issues: write
pull-requests: write
id-token: writeTo prevent abuse, configure rate limits:
with:
rate-limit-per-issue: 10 # Max invocations per issue per hour
rate-limit-per-user: 20 # Max invocations per user per hourwith:
allowed-users: 'admin,lead-dev,security-team'with:
allowed-teams: 'core-team,security'Only respond to issues/PRs with specific labels:
with:
allowed-labels: 'claude-enabled,needs-review'By default, Claude won't analyze sensitive files. Customize the blocklist:
with:
block-sensitive-files: '*.env,*secret*,*credential*,*.key'- Check that
CLAUDE_CODE_OAUTH_TOKENsecret is set - Verify the trigger phrase is in the comment
- Check workflow run logs for errors
- Ensure user is in
allowed-users(if configured)
Increase the timeout for complex analysis:
with:
timeout-minutes: 60Either wait for the rate limit to reset or increase limits:
with:
rate-limit-per-user: 50- Start Simple: Use
basic-claude-assistant.ymlfirst - Restrict in Production: Use
allowed-usersorallowed-teams - Use Configurations: Leverage predefined configs for consistent behavior
- Monitor Usage: Check workflow runs for usage patterns
- Security First: Use
security-reviewconfig for security-sensitive repos