Bobby is a Discord chatbot that helps answer questions about your codebase, file bugs, and translate business requirements into technical requirements. Bobby leverages Claude Code to understand your codebase and provide intelligent responses.
Get Bobby running in under 1 minute:
That's it! Bobby will automatically:
- Install and configure Claude Code CLI
- Authenticate with GitHub
- Clone your repository
- Start monitoring Discord for mentions
Privacy & Security: You create your own Discord bot and run Bobby in your own isolated Docker container. Your code, conversations, and API keys never leave your environment.
- AI-Powered Responses: Uses Claude Code to answer questions about your codebase
- Bug Detection: Automatically creates GitHub issues when bugs are detected
- Thread-Based Sessions: Each conversation maintains context in Discord threads
- Read-Only Design: Analyzes code without making changes
- Privacy-First: Your own Discord bot and isolated Docker container
- Easy Deployment: Complete Docker support with automated setup
Bobby uses Discord threads for session management:
- Start a conversation: Mention Bobby in any channel to create a new thread
- Continue chatting: Type in the thread (no need to mention Bobby again)
- Each thread maintains context: Bobby remembers your conversation history
- Auto-organization: Threads are named based on your questions
Bobby can:
- ✅ Analyze and explore your codebase
- ✅ Answer questions about code functionality
- ✅ Detect bugs and create GitHub issues
- ✅ Provide code recommendations
- ❌ Cannot modify or write code files (read-only by design)
Why Self-Host Bobby?
- 🔒 Complete Privacy: Your code never leaves your infrastructure
- 🏠 Your Own Bot: Create and control your own Discord bot
- 🐳 Isolated Environment: Runs in your own Docker container
- 🔑 Your API Keys: Direct relationship with Anthropic and GitHub
- 🛡️ Zero Trust: No third-party services handling your sensitive data
- Discord Bot Token (see setup instructions below)
- Anthropic API Key for Claude (see setup instructions below)
- GitHub Personal Access Token with repo and issue scopes
- GitHub repository name in the format owner/repo-name
- Bun runtime (for local development only)
- Go to the Discord Developer Portal
- Click "New Application" and give your bot a name (e.g., "Bobby")
- Go to the "Bot" tab and click "Add Bot"
- Configure your bot settings:
- Set the bot's username and avatar
- In the "Privileged Gateway Intents" section, enable:
- Message Content Intent (required to read message content)
- Server Members Intent
- Presence Intent
- IMPORTANT: Under "Authorization Flow", disable the "Public Bot" toggle to make your bot private
- Save your changes
- In the Bot tab, under the "Token" section, click "Reset Token"
- Copy the token that appears (this is your DISCORD_TOKEN)
- IMPORTANT: Keep this token secure and never share it publicly!
- Go to the "OAuth2" > "URL Generator" tab
- Select the following scopes:
- bot
- applications.commands
- In the Bot Permissions section, select:
- Read Messages/View Channels
- Send Messages
- Read Message History
- Use Slash Commands
- Add Reactions
- Copy the generated URL and open it in your browser
- Select the server you want to add the bot to and follow the prompts
- Authorize the bot with the selected permissions
To get your Discord server ID (needed for the server whitelist):
-
Enable Developer Mode:
- Open Discord and go to User Settings (gear icon)
- Navigate to App Settings > Advanced
- Toggle on Developer Mode
-
Get the Server ID:
- Right-click on your server icon in the left sidebar
- Select "Copy ID" from the menu
- The server ID is now in your clipboard
To keep your bot private and prevent unauthorized access:
-
Disable Public Bot Setting: In the Discord Developer Portal under the "Bot" tab, make sure "Public Bot" is disabled. This prevents anyone with your client ID from adding the bot to their server.
-
Server Whitelist: Bobby automatically implements server whitelisting when you provide the ALLOWED_DISCORD_SERVERS environment variable with comma-separated server IDs.
-
Use Environment Variables: Bobby automatically handles server whitelisting via the ALLOWED_DISCORD_SERVERS environment variable.
-
Use Minimal Permissions: Only request the permissions your bot actually needs to function.
-
Regularly Audit Servers: Periodically check which servers your bot has joined and remove it from any unauthorized ones.
-
Create an Anthropic account:
- Go to Anthropic's website
- Click "Sign Up" and follow the prompts to create an account
-
Access the API Console:
- Log in to your Anthropic account
- Navigate to the API Console section
-
Generate an API Key:
- In the API Console, locate the "API Keys" section
- Click "Create New API Key"
- Give your key a descriptive name (e.g., "Bobby Bot")
- Copy and securely store the generated API key immediately (this is your ANTHROPIC_API_KEY)
- IMPORTANT: This key will not be shown again and grants access to paid API usage
Note: When using Docker (recommended), the Claude Code CLI is automatically installed and configured. Manual installation is only needed for local development.
- Go to GitHub's Personal Access Tokens page
- Click "Generate new token" > "Generate new token (classic)"
- Give your token a descriptive name (e.g., "Bobby Bot")
- Set an expiration date (or select "No expiration" for persistent use)
- Select the following scopes:
- repo (Full control of private repositories)
- read:org (if your repositories are within an organization)
- Click "Generate token"
- Copy and securely store the generated token (this is your GH_TOKEN)
- IMPORTANT: This token will not be shown again and grants access to your repositories
Create a .env file with the following variables:
Note: Docker deployment is recommended. Local development requires additional setup:
- Install dependencies: bun install
- Install Claude Code CLI: bun install -g @anthropic-ai/claude-code
- Install and authenticate GitHub CLI
- Start development server: bun run dev
For detailed local setup, see the Docker option above which handles all dependencies automatically.
Option 1: Pre-built Image (Recommended)
Use the official pre-built image from Docker Hub:
Option 2: Build from Source
If you want to build from source or make modifications:
The container will automatically authenticate with GitHub using your GH_TOKEN before starting the bot.
Security Note: The ALLOWED_DISCORD_SERVERS environment variable controls which Discord servers can use your bot. If not specified, all servers will be allowed (not recommended for production).
- Invite the bot to your Discord server
- Mention Bobby (@Bobby) in your message followed by your question
@Bobby what's the authentication flow in our app?
- Bobby will respond with an answer based on your codebase
- If Bobby detects a bug, it will automatically create a GitHub issue
To run Bobby for multiple repositories or organizations, use separate containers:
Each instance maintains separate data storage and session management.
Bobby is automatically published to Docker Hub with every release:
- Repository: stewart86/bobby
- Latest stable: stewart86/bobby:latest
- Specific versions: stewart86/bobby:v1.0.0
GitHub Actions automatically builds and publishes Docker images:
- ✅ On every commit to main: Updates latest tag
- ✅ On version tags: Creates versioned releases (e.g., v1.0.0)
- ✅ Multi-platform support: Built for linux/amd64
- ✅ Description sync: README automatically synced to Docker Hub
Bobby is built with modern JavaScript and Bun runtime. Key components:
- Discord.js: Handles Discord bot interactions and thread management
- Claude Code CLI: Powers AI analysis of codebases
- GitHub CLI: Creates issues automatically when bugs are detected
- Bun: Fast JavaScript runtime for better performance
See CONTRIBUTING.md for detailed development guidelines, code architecture, and how to contribute to the project.
Bobby uses the CLAUDE.md file for storing project instructions and context that helps Claude understand the codebase and provide better responses during conversations.
If you encounter authentication errors with Claude, this is a known issue tracked in the Claude Code repository.
Error symptoms:
- Bobby fails to start with Claude authentication errors
- API key authentication failures in container logs
Workaround:
-
Access the running Docker container:
docker exec -it bobby /bin/sh -
Manually authenticate Claude Code CLI:
claude # Follow the interactive prompts to authenticate -
Exit the container - Bobby should now work properly:
This issue typically resolves itself once Claude Code CLI is manually authenticated within the container environment.
MIT License - see LICENSE file for details.