SlackBridge.Claude
Remote control Claude Code from Slack. Post prompts in a Slack channel from your phone, get responses back in threads.
You (Slack) → Socket Mode WebSocket → C# MCP Server (stdio) → Claude Code session
← reply/react/edit tools ←
How It Works
- Messages you send in Slack are forwarded to your Claude Code session as MCP channel notifications
- Claude Code processes the prompt and replies back via threaded Slack messages
- One Slack channel per Claude Code instance — channel name auto-derives from the working directory (e.g., project
MyApp → #my-app)
- Uses Socket Mode (no public URL needed, works on free Slack plans)
- The channel is auto-created if it doesn't exist
Prerequisites
Setup
1. Create a Slack App
- Go to api.slack.com/apps and click Create New App → From scratch
- Name it whatever you like (e.g., "Claude Bridge") and select your workspace
2. Configure Bot Token Scopes
Under OAuth & Permissions → Scopes → Bot Token Scopes, add:
| Scope | Purpose |
|---|
channels:history | Read messages in public channels |
channels:read | List channels to find/resolve the target channel |
channels:manage | Auto-create the channel if it doesn't exist |
chat:write | Post replies and messages |
reactions:read | Read reactions |
reactions:write | Add/remove emoji reactions on messages |
files:write | Upload files to Slack |
users:read | Resolve user display names |
3. Enable Socket Mode
Under Socket Mode, toggle it on. This generates an App-Level Token — create one with the connections:write scope. Save this token (xapp-...).
4. Enable Event Subscriptions
Under Event Subscriptions, toggle it on, then under Subscribe to bot events, add:
message.channels — triggers when a message is posted in a public channel
5. Install the App
Under Install App, click Install to Workspace and authorize. Save the Bot User OAuth Token (xoxb-...).
6. Set Environment Variables
Set these as persistent environment variables (not just shell exports — they need to be available to Claude Code):
# Linux/macOS
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_APP_TOKEN="xapp-your-app-token"
# Windows (PowerShell — sets permanently for your user)
[System.Environment]::SetEnvironmentVariable('SLACK_BOT_TOKEN', 'xoxb-your-bot-token', 'User')
[System.Environment]::SetEnvironmentVariable('SLACK_APP_TOKEN', 'xapp-your-app-token', 'User')
Optionally set SLACK_CHANNEL to override the auto-derived channel name.
7. Build & Publish
git clone https://github.com/blakeja/slack-bridge-claude.git
cd slack-bridge-claude
# Development (requires .NET 10 SDK):
dotnet build -c Release
# Self-contained publish (no .NET runtime needed on target machine):
# Windows
dotnet publish src/SlackBridge.Claude -c Release -r win-x64
dotnet publish src/SlackBridge.Claude.Hook -c Release -r win-x64
# macOS (Apple Silicon)
dotnet publish src/SlackBridge.Claude -c Release -r osx-arm64
dotnet publish src/SlackBridge.Claude.Hook -c Release -r osx-arm64
# macOS (Intel)
dotnet publish src/SlackBridge.Claude -c Release -r osx-x64
dotnet publish src/SlackBridge.Claude.Hook -c Release -r osx-x64
# Linux
dotnet publish src/SlackBridge.Claude -c Release -r linux-x64
dotnet publish src/SlackBridge.Claude.Hook -c Release -r linux-x64
8. Run with Claude Code
claude --dangerously-load-development-channels server:slack-bridge
This starts Claude Code with the SlackBridge MCP server. The server will:
- Connect to Slack via Socket Mode
- Find or create a channel named after the current directory
- Listen for messages and forward them to Claude Code
- Provide tools for Claude Code to reply, react, and edit messages
9. Invite the Bot
The bot auto-creates the channel, but if the channel already exists, make sure the bot is a member. In Slack, go to the channel and run /invite @YourBotName.
Usage
Once running, just send a message in the Slack channel. Claude Code will:
- React with :eyes: to acknowledge receipt
- Process the prompt
- Reply in a thread with the response
- React with :white_check_mark: when done
Long responses are automatically chunked to fit Slack's message limits.
MCP Tools
The server exposes four tools to Claude Code:
| Tool | Description |
|---|
reply | Post a threaded reply (auto-chunks long messages) |
react | Add/remove emoji reactions on messages |
edit_message | Update a previously posted bot message |
upload_file | Upload a file to the channel (from content or file path) |