Slack Setup
Connect your CCCC working group to Slack for team collaboration.
Overview
Slack integration uses Socket Mode for real-time messaging. It's ideal for:
- Team collaboration
- Enterprise environments
- Existing Slack workspaces
Prerequisites
- A Slack workspace where you have admin rights
- CCCC installed and running
Step 1: Create a Slack App
- Go to Slack API Apps
- Click Create New App
- Choose From scratch
- Enter app name (e.g., "CCCC Bot")
- Select your workspace
- Click Create App
Step 2: Enable Socket Mode
Socket Mode allows the bot to receive events without exposing a public URL.
- In your app settings, go to Socket Mode
- Toggle Enable Socket Mode to ON
- Click Generate to create an app-level token
- Name it (e.g., "cccc-socket-token")
- Add the scope
connections:write - Click Generate
- Copy the token (starts with
xapp-)
TIP
This is your App Token, used for the WebSocket connection.
Step 3: Configure Bot Permissions
- Go to OAuth & Permissions
- Under Scopes → Bot Token Scopes, add:
| Scope | Purpose |
|---|---|
chat:write | Send messages |
channels:history | Read public channel messages |
groups:history | Read private channel messages |
im:history | Read direct messages |
mpim:history | Read group DMs |
files:read | Read shared files |
files:write | Upload files |
users:read | Read user info |
Step 4: Enable Event Subscriptions
- Go to Event Subscriptions
- Toggle Enable Events to ON
- Under Subscribe to bot events, add:
| Event | Purpose |
|---|---|
message.channels | Messages in public channels |
message.groups | Messages in private channels |
message.im | Direct messages |
message.mpim | Group DMs |
app_mention | When bot is @mentioned |
- Click Save Changes
Step 5: Install to Workspace
- Go to OAuth & Permissions
- Click Install to Workspace
- Review permissions and click Allow
- Copy the Bot Token (starts with
xoxb-)
Step 6: Set Environment Variables
# Add to your shell profile
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_APP_TOKEN="xapp-your-app-token"Two Tokens Required
Slack requires both tokens:
- Bot Token (
xoxb-): For API calls - App Token (
xapp-): For Socket Mode connection
Step 7: Configure CCCC
Option A: Via Web UI
- Open the CCCC Web UI at
http://127.0.0.1:8848/ - Go to Settings (gear icon in header)
- Navigate to the IM Bridge section
- Select Slack as the platform
- Enter your credentials:
- Bot Token Environment Variable:
SLACK_BOT_TOKEN - App Token Environment Variable:
SLACK_APP_TOKEN
- Bot Token Environment Variable:
- Click Save
Option B: Via CLI
cccc im set slack \
--bot-token-env SLACK_BOT_TOKEN \
--app-token-env SLACK_APP_TOKENBoth methods save to group.yaml:
im:
platform: slack
bot_token_env: SLACK_BOT_TOKEN
app_token_env: SLACK_APP_TOKENStep 8: Start the Bridge
cccc im startStep 9: Subscribe in Slack
- Invite the bot to a channel:
/invite @your-bot-name - Send
/subscribein the channel - You should receive a confirmation
For direct messages:
- Find the bot in your DMs
- Send
/subscribe
Usage
Sending Messages to Agents
In channels, @mention the bot first, then use the /send command:
@YourBotName /send Please implement the user authentication moduleIn direct messages with the bot, you can use /send directly:
/send Please implement the user authentication moduleImportant
- In channels, you must @mention the bot before using commands
- Plain messages without the
/sendcommand are ignored
Targeting Specific Agents
Use @mention syntax with the /send command (use CCCC's syntax, not Slack's):
/send @foreman Review the latest commits
/send @backend-agent Fix the API endpoint
/send @all Status update pleaseReceiving Messages
After subscribing, you will automatically receive:
- Agent responses
- Status updates
- Error notifications
Use /verbose to toggle whether you see agent-to-agent messages.
Thread Replies
Reply in threads to keep conversations organized. CCCC preserves thread context.
File Sharing
Attach files to your message. They're uploaded to CCCC's blob storage, then forwarded to agents.
Commands Reference
| Command | Description |
|---|---|
/subscribe | Start receiving messages from CCCC |
/unsubscribe | Stop receiving messages |
/send <message> | Send to foreman (default) |
/send @<actor> <message> | Send to a specific agent |
/send @all <message> | Send to all agents |
/send @peers <message> | Send to non-foreman agents |
/status | Show group and agent status |
/pause | Pause delivery |
/resume | Resume delivery |
/verbose | Toggle verbose mode |
/help | Show help |
Troubleshooting
"invalid_auth" Error
Token is invalid or expired:
- Go to OAuth & Permissions
- Click Reinstall to Workspace
- Update your
SLACK_BOT_TOKENenvironment variable
"missing_scope" Error
Add the required scope:
- Go to OAuth & Permissions
- Add the missing scope under Bot Token Scopes
- Reinstall the app
Bot not receiving messages
- Check Socket Mode is enabled
- Verify
SLACK_APP_TOKENis correct - Ensure events are subscribed in Event Subscriptions
- Check the bot is invited to the channel
Connection drops
Socket Mode connections may drop occasionally. CCCC auto-reconnects, but if issues persist:
cccc im stop
cccc im startAdvanced Configuration
Channel Restrictions
Limit which channels the bot responds to:
im:
platform: slack
bot_token_env: SLACK_BOT_TOKEN
app_token_env: SLACK_APP_TOKEN
allowed_channels:
- C01234567 # Channel ID
- C89012345Custom Bot Name
The display name is set in Slack:
- Go to App Home
- Under Your App's Presence in Slack
- Edit Display Name
Security Notes
- Bot tokens have broad access - limit to necessary workspaces
- Review channel membership regularly
- Consider using Enterprise Grid for additional controls
- Audit who can install apps in your workspace