Automatically responds to GitHub events on your behalf using Claude, and notifies you on Slack.
| Event | Trigger | Claude action |
|---|---|---|
| Issue opened | New issue in your repos | Acknowledges + asks clarifying questions |
| Issue assigned | Issue assigned to you | Confirms assignment + next steps |
| PR assigned | PR assigned to you | Reviews diff + acknowledges |
| @mention | Anyone mentions you in a comment | Replies directly to the question |
Option A — Personal Access Token (easiest for local)
- Go to https://github.com/settings/tokens → Generate new token (classic)
- Scopes:
repo,write:discussion - Copy the token →
GITHUB_TOKENin.env
Option B — GitHub App (more secure)
- Go to https://github.com/settings/apps → New GitHub App
- Webhook URL:
https://<your-tunnel>/github/webhook - Webhook secret: any random string →
WEBHOOK_SECRETin.env - Subscribe to: Issues, Pull requests, Issue comments
- Permissions: Issues (Read & Write), Pull requests (Read & Write)
- Install the app on your repos
- Go to https://api.slack.com/apps → Create New App → From scratch
- Features → Incoming Webhooks → Activate
- Add New Webhook to Workspace → pick your channel
- Copy the webhook URL →
SLACK_WEBHOOK_URLin.env
cp .env.example .env
# Fill in all valuespython -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000# ngrok
ngrok http 8000
# OR cloudflared (if you already have it set up)
cloudflared tunnel --url http://localhost:8000Set the tunnel URL as your GitHub App webhook URL:
https://<tunnel-id>.trycloudflare.com/github/webhook
github-bot/
├── app/
│ ├── main.py # FastAPI app + webhook router
│ ├── config.py # Env vars
│ ├── handlers/
│ │ ├── issue.py # issue_opened, issue_assigned
│ │ ├── pr.py # pr_assigned
│ │ └── comment.py # @mention handler
│ └── services/
│ ├── claude.py # Anthropic API wrapper
│ ├── github.py # GitHub API calls
│ └── slack.py # Slack Incoming Webhook
├── requirements.txt
├── .env.example
└── README.md
The bot skips comments made by your own username or the bot name to avoid infinite reply loops. Comment IDs are tracked in memory (restart clears them). For production, swap with a Redis set.
When you're ready to move from local to your Contabo VPS:
- Add a
Dockerfile+docker-compose.yml - Add a Traefik label for routing
- Point your GitHub App webhook URL to
https://github-bot.yourdomain.com/github/webhook