info
This documentation is automatically synchronized from the claude-hub repository. Last updated: 2025-06-01
Claude GitHub Integration Workflow
This document describes the workflow for how GitHub comments trigger Claude responses through our integration.
Workflow Diagram
Detailed Flow
-
GitHub Comment Trigger
- User creates a GitHub comment mentioning the bot with a command
- GitHub detects the comment creation event
-
Webhook Delivery
- GitHub sends a webhook event to
claude.jonathanflatt.org
- The payload contains the comment content, issue/PR information, and repository details
- GitHub sends a webhook event to
-
API Endpoint Processing
- Express server receives the webhook at
/api/webhooks/github
githubController.handleWebhook
processes the incoming request
- Express server receives the webhook at
-
Webhook Verification
- The controller verifies the webhook signature to ensure it came from GitHub
- Validates the event type is
issue_comment
and action iscreated
-
Command Extraction
- For issue comments, the code checks for mentions of the configured bot username
- If found, it extracts the command text that follows the mention
-
Claude Service Processing
claudeService.processCommand
clones the repository to a temporary directory- Prepares the environment for Claude Code execution
-
Claude Code CLI Execution
- Claude Code CLI is executed with the command in the repository context
- Uses AWS Bedrock credentials for Claude API access if configured
-
Response Generation
- Claude processes the command and generates a detailed response
- The response is captured from the CLI output
-
GitHub Response Posting
githubService.postComment
posts the response as a comment- Uses GitHub API to add the comment to the original issue/PR
-
Workflow Completion
- The response appears on GitHub, visible to all repository users
- The temporary repository clone is deleted
System Components
- Express Server: Handles incoming webhook requests
- GitHub Controller: Processes GitHub events and orchestrates the workflow
- Claude Service: Interfaces with Claude Code CLI
- GitHub Service: Manages GitHub API interactions
Environment Requirements
- GitHub token with repository access
- Claude Code CLI installed
- AWS credentials (if using Bedrock configuration)
- Webhook endpoints properly configured