Part 8 of 10
You've been using Claude Code locally—commands, skills, subagents, MCP servers. It's transformed how you work. But what about when you're not at your terminal? What about your team?
Claude Code's GitHub integration lets you @mention Claude directly in issues and PRs. Your team can get AI assistance without everyone installing anything locally. And with GitHub Actions, Claude can review every PR automatically.
The GitHub Integration
With a simple @claude mention in any PR or issue, Claude can:
- Analyze code — Review PRs, explain changes, find issues
- Create pull requests — Implement features from issue descriptions
- Fix bugs — Investigate, identify root cause, submit patches
- Answer questions — Explain codebase patterns and architecture
- Follow your standards — Uses your CLAUDE.md conventions
All of this happens asynchronously. You mention @claude, go grab coffee, and come back to a PR or detailed analysis.
Installation
The easiest setup is through Claude Code itself:
claude/install-github-app
This command guides you through:
- Installing the Claude GitHub App on your repository
- Authorizing the required permissions
- Setting up the
ANTHROPIC_API_KEYsecret
You need repository admin access to complete installation.
Manual Setup
If you prefer manual configuration:
- Create the workflow file at
.github/workflows/claude.yml:
name: Claude Code Assistanton:issue_comment:types: [created]pull_request:types: [opened, synchronize]issues:types: [opened, labeled]permissions:contents: readpull-requests: writeissues: writejobs:claude:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4with:fetch-depth: 0- uses: anthropics/claude-code-action@v1with:anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
-
Add your API key: Repository Settings → Secrets → Add
ANTHROPIC_API_KEY -
Commit and push the workflow file
@claude Mentions
Once installed, mention @claude in any issue or PR to trigger assistance.
In Issues
@claude implement this feature following our auth patterns
Claude analyzes the issue, creates a plan, and opens a PR with the implementation.
@claude investigate why users are seeing timeout errors in the checkout flow
Claude explores the codebase, identifies potential causes, and reports findings.
In Pull Requests
@claude review this PR for security issues
Claude analyzes the diff, comments on specific lines, and provides a summary.
@claude explain why this approach was chosen over using a state machine
Claude reads the changes, understands the context, and explains the reasoning.
In PR Comments
@claude can you refactor this to use async/await instead of callbacks?
Claude updates the code and pushes a new commit to the PR.
@claude add tests for the edge cases you identified
Claude writes and commits the additional tests.
Workflow Triggers
Configure when Claude activates:
Comment-Triggered (Interactive)
on:issue_comment:types: [created]
Claude responds to @claude mentions in comments. Most flexible—team members trigger it when needed.
PR-Triggered (Automatic Review)
on:pull_request:types: [opened, synchronize]
Claude automatically reviews every new PR and when new commits are pushed. Add a prompt to specify what to look for:
- uses: anthropics/claude-code-action@v1with:anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}prompt: "Review this PR for security vulnerabilities, performance issues, and adherence to our coding standards"
Issue-Triggered (Auto-Triage)
on:issues:types: [opened, labeled]
Claude can triage new issues, add labels, or start implementation when specific labels are applied.
Scheduled (Maintenance)
on:schedule:- cron: '0 9 * * 1' # Every Monday at 9 AM
Run maintenance tasks: dependency updates, documentation refresh, codebase health checks.
Production Workflow Patterns
Pattern 1: Dual-Loop Review
Combine automated checks with AI review:
jobs:automated-checks:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- run: npm ci- run: npm run lint- run: npm run typecheck- run: npm run testai-review:needs: automated-checksruns-on: ubuntu-lateststeps:- uses: actions/checkout@v4- uses: anthropics/claude-code-action@v1with:anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}prompt: |Review this PR for:1. Logic errors the linter wouldn't catch2. Architecture and design concerns3. Performance implications4. Missing edge casesAutomated checks already passed. Focus on higher-level review.
Why it works: Linters catch syntax issues. Claude catches design problems. Together, they're comprehensive.

Pattern 2: Spec-Driven Development
Structure your workflow from requirements to implementation:
1. Requirements Phase└── Create detailed issue with acceptance criteria└── @claude to create implementation plan└── Review and refine plan2. Implementation Phase└── Approve plan → Claude creates PR└── Automated tests run└── Human review3. Merge Phase└── Final approval└── Merge and deploy
Example issue:
## Feature: User Export### Requirements- Export user data as CSV or JSON- Include: name, email, signup date, last login- Admins only- Max 10,000 records per export### Acceptance Criteria- [ ] Export button on admin dashboard- [ ] Format selection (CSV/JSON)- [ ] Progress indicator for large exports- [ ] Download link sent via email for exports > 1000 records@claude implement this following our existing export patterns in src/exports/
Pattern 3: Bug Fix Pipeline
Streamlined bug investigation and fixing:
## Bug: Checkout fails for international addresses### Reproduction1. Add item to cart2. Enter shipping address with non-US country3. Click "Continue to Payment"4. Error: "Invalid address format"### ExpectedCheckout should accept international addresses@claude investigate and fix this bug
Claude will:
- Analyze the codebase for address handling
- Identify the root cause
- Create a PR with the fix
- Add tests for international addresses
Pattern 4: Path-Specific Reviews
Trigger different review depth based on what changed:
jobs:security-review:if: contains(github.event.pull_request.changed_files, 'auth/') ||contains(github.event.pull_request.changed_files, 'payments/')runs-on: ubuntu-lateststeps:- uses: anthropics/claude-code-action@v1with:anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}prompt: |CRITICAL SECURITY REVIEWThis PR modifies authentication or payment code.Perform a thorough security audit:- Check for injection vulnerabilities- Verify authentication/authorization- Look for data exposure risks- Validate input sanitizationFlag any concerns for human review before merge.
Team Configuration
Shared CLAUDE.md for Teams
Your project's CLAUDE.md is used by both local Claude Code and GitHub Actions. Include team-specific instructions:
# Team Project Standards## @claude TriggersWhen responding to GitHub mentions:- `@claude review` - Full code review with security focus- `@claude implement` - Create PR from issue description- `@claude fix` - Investigate and patch bugs- `@claude explain` - Explain code or architecture decisions- `@claude triage` - Analyze and label new issues## PR Requirements- All PRs require passing tests before Claude review- Security-critical changes require human approval- Database migrations require team lead review## Coding Conventions[Your existing coding standards...]## Restricted AreasDo not automatically modify:- config/production.json - Requires manual review- database/migrations/ - Requires team lead approval- src/auth/ - Security-critical, flag for review- src/payments/ - PCI compliance, flag for review
Permission Boundaries
Configure what Claude can and cannot do:
permissions:contents: read # Can read filespull-requests: write # Can comment on PRsissues: write # Can comment on issues# Note: Cannot merge PRs without additional config
Always require human approval for merges. Claude can review, suggest, and even commit—but a human should click the merge button.

Authentication Options
Direct API (Recommended)
- uses: anthropics/claude-code-action@v1with:anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Most straightforward. You pay per-token through your Anthropic account.
Amazon Bedrock
- uses: anthropics/claude-code-action@v1with:provider: bedrockaws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}aws_region: us-east-1
For enterprise environments with AWS infrastructure.
Google Vertex AI
- uses: anthropics/claude-code-action@v1with:provider: vertexgcp_project_id: ${{ secrets.GCP_PROJECT_ID }}gcp_region: us-central1
For teams on Google Cloud.
Cost Management
GitHub Actions usage + API tokens can add up. Monitor and control costs:
Set Token Limits
- uses: anthropics/claude-code-action@v1with:anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}max_tokens: 4096
Limit Trigger Frequency
on:pull_request:types: [opened] # Only on open, not on every pushpaths:- 'src/**' # Only when source files change- '!**.md' # Ignore documentation changes
Use Labels as Gates
on:pull_request:types: [labeled]jobs:claude-review:if: github.event.label.name == 'needs-ai-review'
Only trigger when a specific label is applied.
Best Practices
1. Be Specific with Instructions
# Vague (worse results)@claude review this# Specific (better results)@claude review this PR for SQL injection vulnerabilitiesin the new user search endpoint, focusing on the queryconstruction in src/api/users.ts
2. Provide Context
@claude implement this featureThis should follow the same patterns as our existingexport functionality in src/exports/. Use the ExportJobqueue for async processing like we do for report generation.
3. Iterate and Refine
Treat Claude like a junior developer who benefits from feedback:
@claude that's close, but we need to handle the casewhere the user has no email address. Can you add afallback to use their username instead?
4. Document Team Commands
Create a team reference for @claude usage:
## Team @claude Commands Reference- `@claude review` — Full code review — Use on all PRs- `@claude security` — Security-focused review — Use on auth/payment changes- `@claude implement` — Create implementation — Use on feature issues- `@claude fix` — Investigate and patch — Use on bug issues- `@claude explain` — Explain code/decisions — Use for onboarding, complex PRs
5. Protect Sensitive Code
Configure Claude to flag rather than modify critical areas:
## In CLAUDE.mdWhen reviewing or implementing changes that touch:- src/auth/- src/payments/- config/production.json- database/migrations/DO NOT make changes directly. Instead:1. Flag the file as security-critical2. Describe what changes would be needed3. Request human review before any modifications
Troubleshooting
Claude Doesn't Respond to Mentions
- Check the workflow file exists at
.github/workflows/claude.yml - Verify
ANTHROPIC_API_KEYsecret is set - Check Actions tab for workflow run logs
- Ensure issue_comment trigger is configured
Response is Cut Off
Token limits may be too low. Increase max_tokens in the action config.
Claude Makes Wrong Assumptions
Add more context to CLAUDE.md or be more specific in your mention.
High Costs
- Use label-gated triggers instead of automatic on every PR
- Limit to specific file paths
- Reduce max_tokens
- Use Haiku for simple tasks, Opus for complex ones
Quick Reference
# Install GitHub integration/install-github-app# Workflow file location.github/workflows/claude.yml
Common @claude commands:
@claude review # Code review@claude review security # Security-focused review@claude implement # Create PR from issue@claude fix # Investigate and patch bug@claude explain # Explain code/decisions@claude add tests # Add test coverage@claude refactor # Improve code quality
Workflow triggers:
on:issue_comment: # @claude mentionspull_request: # Automatic PR reviewissues: # Issue triageschedule: # Scheduled maintenance
Key action inputs:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}prompt: "Your instructions here"max_tokens: 4096
What's Next
You now have Claude integrated into your development workflow—locally and on GitHub. Commands, skills, subagents, MCP servers, and GitHub Actions give you a complete AI-assisted development toolkit.
In Part 9: Power User Secrets, we'll explore advanced techniques that experienced users rely on: prompt engineering patterns, debugging strategies, and workflows that maximize Claude's capabilities.
Previous: Part 7: MCP Servers
Stay Updated
Get notified about new tutorials on Claude Code, productivity tips, and automation guides.
No spam, ever. Unsubscribe anytime.
