Add GitHub issue/PR comments as a second input channel#3
Open
Add GitHub issue/PR comments as a second input channel#3
Conversation
When GITHUB_TOKEN is set, Claudex now starts a lightweight HTTP webhook server (default port 8080) alongside the existing Slack Socket Mode connection. Mentioning @claudex in a GitHub issue or PR comment routes the message through the same Claude Code session infrastructure used for Slack — no separate service required. Sessions are keyed by `gh:{owner/repo}#{issue_number}` in the existing store, so context persists across the full issue/PR thread exactly as it does per Slack thread. Responses are posted back as GitHub comments via the REST API. New files: - src/github/handler.ts webhook server, signature verification, session routing - src/github/post.ts post comments back to GitHub Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@claudexis mentioned in a GitHub issue or PR comment, it routes through the samecreateSession/resumeSessioninfrastructure already used for Slackgh:{owner/repo}#{issue_number}in the existing store, so Claude retains context across the full issue/PR thread exactly as it does per Slack threadGITHUB_TOKENis setNew files
src/github/post.ts— posts a comment to a GitHub issue/PR via the REST APIsrc/github/handler.ts— the webhook server:http.ServeronGITHUB_WEBHOOK_PORT(default8080)X-Hub-Signature-256(skips ifGITHUB_WEBHOOK_SECRETnot set, for easy local dev)issue_commentevents where the comment body containsGITHUB_BOT_HANDLE(default@claudex)repo + issue_number→ session key →createSession/resumeSessionModified files
src/index.ts— conditionally starts the webhook server after the Slack appREADME.md— documents new env vars and GitHub App setup stepsNew env vars (all optional)
GITHUB_TOKENissues: writeGITHUB_WEBHOOK_SECRETX-Hub-Signature-256verificationGITHUB_BOT_HANDLE@claudexGITHUB_WEBHOOK_PORT8080Test plan
GITHUB_TOKEN+GITHUB_WEBHOOK_SECRET, restart Claudex — confirm⚡ GitHub webhook server listening on port 8080in logsGITHUB_TOKENunset — confirmGitHub webhook server disabledlog, Slack still worksghCLI orcurl) — confirm Claude responds as a commentsessionIdin logs)401 Unauthorized🤖 Generated with Claude Code