info
This documentation is automatically synchronized from the claude-hub repository. Last updated: 2025-06-01
GitHub Workflow with Claude Webhook
This document describes how the GitHub webhook integration works with Claude Code CLI.
Overview
When someone mentions the configured bot (via BOT_USERNAME environment variable) in a GitHub issue or pull request comment, the following workflow is triggered:
- GitHub sends a webhook to our service
- The service validates the webhook signature
- If valid, it extracts the command after the bot username
- A Docker container is spun up with Claude Code CLI
- The repository is cloned and the correct branch is checked out
- Claude Code executes the command with full GitHub CLI access
- The response is returned via the webhook HTTP response (not posted as a GitHub comment)
Architecture
GitHub Issue/PR Comment
↓
GitHub Webhook
↓
Node.js Webhook Service
↓
Docker Container (Claude Code + GitHub CLI)
↓
HTTP Response (JSON with Claude's response)
Container Environment
Each request runs in an isolated Docker container with:
- Claude Code CLI
- GitHub CLI (authenticated)
- Git (with proper credentials)
- AWS CLI (for Bedrock access)
Supported Events
- Issue Comments: When the bot is mentioned in an issue comment
- Pull Request Comments: When the bot is mentioned in a PR comment
- Pull Request Review Comments: When the bot is mentioned in a PR review
Authentication
The following credentials are required:
GITHUB_TOKEN
: For repository access and API calls- AWS credentials: For Claude Code Bedrock access
GITHUB_WEBHOOK_SECRET
: For webhook signature verification
Example Usage
In a GitHub issue or PR comment:
@ClaudeBot Please analyze the performance of the current implementation and suggest optimizations.
Claude will:
- Clone the repository
- Checkout the appropriate branch (main for issues, PR branch for PRs)
- Analyze the code
- Return the response via the webhook HTTP response with suggestions
Available Claude Commands
Claude Code has access to:
- File operations (Read, Write, Edit)
- Git operations
- GitHub CLI for:
- Creating/updating issues
- Managing pull requests
- Adding comments
- Reviewing code
- Approving/requesting changes
Configuration
Environment variables required:
GITHUB_TOKEN
: GitHub personal access token with repo accessGITHUB_WEBHOOK_SECRET
: Secret for webhook verificationAWS_ACCESS_KEY_ID
: AWS access keyAWS_SECRET_ACCESS_KEY
: AWS secret keyAWS_REGION
: AWS region (default: us-east-1)CLAUDE_CODE_USE_BEDROCK
: Set to "1" to use BedrockANTHROPIC_MODEL
: Model to use (e.g., anthropic.claude-3-sonnet-20240229-v1:0)