Tutorials
10 min read

Claude Code Mastery Part 8: Production Workflows

Move from experimentation to production with GitHub Actions integration, @claude mentions, automated PR reviews, and team workflows that scale.

Jo Vinkenroye
January 15, 2026
Claude Code Mastery Part 8: Production Workflows

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:

  1. Installing the Claude GitHub App on your repository
  2. Authorizing the required permissions
  3. Setting up the ANTHROPIC_API_KEY secret

You need repository admin access to complete installation.

Manual Setup

If you prefer manual configuration:

  1. Create the workflow file at .github/workflows/claude.yml:
name: Claude Code Assistant
on:
issue_comment:
types: [created]
pull_request:
types: [opened, synchronize]
issues:
types: [opened, labeled]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
claude:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
  1. Add your API key: Repository Settings → Secrets → Add ANTHROPIC_API_KEY

  2. 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@v1
with:
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-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run test
ai-review:
needs: automated-checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
Review this PR for:
1. Logic errors the linter wouldn't catch
2. Architecture and design concerns
3. Performance implications
4. Missing edge cases
Automated checks already passed. Focus on higher-level review.

Why it works: Linters catch syntax issues. Claude catches design problems. Together, they're comprehensive.

Two buttons meme - sweating over trusting the linter vs trusting Claude's review
Two buttons meme - sweating over trusting the linter vs trusting Claude's review

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 plan
2. Implementation Phase
└── Approve plan → Claude creates PR
└── Automated tests run
└── Human review
3. 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
### Reproduction
1. Add item to cart
2. Enter shipping address with non-US country
3. Click "Continue to Payment"
4. Error: "Invalid address format"
### Expected
Checkout should accept international addresses
@claude investigate and fix this bug

Claude will:

  1. Analyze the codebase for address handling
  2. Identify the root cause
  3. Create a PR with the fix
  4. 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-latest
steps:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
CRITICAL SECURITY REVIEW
This 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 sanitization
Flag 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 Triggers
When 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 Areas
Do 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 files
pull-requests: write # Can comment on PRs
issues: 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.

Change my mind meme - Claude should auto-merge PRs without human review
Change my mind meme - Claude should auto-merge PRs without human review

Authentication Options

- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

Most straightforward. You pay per-token through your Anthropic account.

Amazon Bedrock

- uses: anthropics/claude-code-action@v1
with:
provider: bedrock
aws_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@v1
with:
provider: vertex
gcp_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@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
max_tokens: 4096

Limit Trigger Frequency

on:
pull_request:
types: [opened] # Only on open, not on every push
paths:
- '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 vulnerabilities
in the new user search endpoint, focusing on the query
construction in src/api/users.ts

2. Provide Context

@claude implement this feature
This should follow the same patterns as our existing
export functionality in src/exports/. Use the ExportJob
queue 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 case
where the user has no email address. Can you add a
fallback 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.md
When 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-critical
2. Describe what changes would be needed
3. Request human review before any modifications

Troubleshooting

Claude Doesn't Respond to Mentions

  1. Check the workflow file exists at .github/workflows/claude.yml
  2. Verify ANTHROPIC_API_KEY secret is set
  3. Check Actions tab for workflow run logs
  4. 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 mentions
pull_request: # Automatic PR review
issues: # Issue triage
schedule: # 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.

Comments

Related Posts