Overview
The Slack channel uses Socket Mode with the Bolt framework to connect to Slack. No public URL or webhook endpoint is needed — the connection is initiated from your server.Installation
Run the/add-slack skill in Claude Code:
- Install the Slack channel code
- Add required dependencies (
@slack/bolt) - Guide you through Slack app creation
- Configure authentication
- Register your first channel
Creating a Slack App
Create Application
- Go to api.slack.com/apps
- Click Create New App → From scratch
- Enter app name (e.g., “Andy Assistant”) and select your workspace
Enable Socket Mode
- Go to Settings → Socket Mode
- Toggle Enable Socket Mode to ON
- Click Generate to create an App-Level Token
- Name it “Socket Mode Token” and add scope
connections:write - Copy the token (starts with
xapp-) — this is yourSLACK_APP_TOKEN
Subscribe to Events
- Go to Event Subscriptions
- Toggle Enable Events to ON
- Under Subscribe to bot events, add:
message.channels- Messages in public channelsmessage.groups- Messages in private channelsmessage.im- Direct messages
Add OAuth Scopes
- Go to OAuth & Permissions
- Under Bot Token Scopes, add:
chat:write- Send messageschannels:history- Read public channel messagesgroups:history- Read private channel messagesim:history- Read direct messageschannels:read- View public channelsgroups:read- View private channelsusers:read- Read user display names
For detailed setup with screenshots, see the SLACK_SETUP.md guide.
Configuration
Add both tokens to.env:
Channel Registration
Getting the Channel ID
Add Bot to Channel
- Open the Slack channel
- Right-click channel name → View channel details
- Go to Integrations tab
- Click Add apps and select your bot
Registering a Main Channel
Main channels respond to all messages (no trigger required):Registering Additional Channels
Additional channels require the trigger pattern:How It Works
Connection
- Slack channel reads tokens from
.env - Creates Bolt app with Socket Mode enabled
- Connects via WebSocket (no public URL needed)
- Listens for message events
Message Handling
Thread Flattening Message Splitting Slack has a 4000-character limit per message. Long responses are automatically split:Splitting is naive (fixed 4000-char boundary). It may break mid-word or mid-sentence.
Channel Metadata Sync
The channel syncs metadata for all channels the bot is a member of:Troubleshooting
Bot Not Responding
Bot Connected But Not Receiving Messages
- Verify Socket Mode is enabled: Slack app settings → Socket Mode → ON
- Verify event subscriptions: Should have
message.channels,message.groups,message.im - Verify bot is added to channel: Check Integrations tab in channel details
- Verify OAuth scopes: Should have
channels:historyand/orgroups:history
”missing_scope” Errors
Implementation Details
Dependencies
@slack/bolt- Slack Bolt framework with Socket Mode support@slack/types- TypeScript types for Slack API
JID Format
- Public channels:
slack:C0123456789 - Private channels:
slack:G0123456789 - Direct messages:
slack:D0123456789
Self-Registration Code
SLACK_BOT_TOKEN and SLACK_APP_TOKEN are set.
Known Limitations
- Threads are flattened — No thread-aware routing (requires database schema changes)
- No typing indicator — Slack Bot API doesn’t expose a typing endpoint
- Naive message splitting — Fixed 4000-char boundary may break mid-sentence
- No file/image handling — Only text content is processed
- Unbounded metadata sync — May be slow in workspaces with thousands of channels
Next Steps
Add Discord
Add Discord as another channel
Channel Overview
Learn about the channel system