Overview
The Slack integration uses @slack/bolt with Socket Mode, which means no public URL is required. The bot connects directly to Slack from your machine.Features
- Socket Mode - No webhooks or public URLs needed
- Public and private channels - Respond in any channel the bot is added to
- Direct messages - Users can DM the bot directly
- Multi-channel support - Monitor multiple channels simultaneously
- Channel metadata sync - Automatically syncs channel names
- Thread flattening - Reads threaded replies (responds in main channel)
Adding Slack
Use the/add-slack skill to add Slack support:
Choose deployment mode
- Replace existing channels - Slack becomes the only channel
- Alongside - Add Slack alongside existing channels
Apply code changes
The skill merges the
skill/slack branch which adds:src/channels/slack.ts(SlackChannel implementation)src/channels/slack.test.ts(46 unit tests)- Multi-channel support in
src/index.ts - Slack config in
src/config.ts - The
@slack/boltNPM package
Creating a Slack app
The setup process requires two tokens: a Bot Token (xoxb-) and an App-Level Token (xapp-).
Quick setup
Create the app
- Go to api.slack.com/apps
- Click Create New App → From scratch
- Enter app name and select workspace
Enable Socket Mode
- Go to Socket Mode in sidebar
- Toggle Enable Socket Mode to On
- Generate token with name
nanoclaw - Copy the App-Level Token (starts with
xapp-)
Subscribe to events
- Go to Event Subscriptions
- Toggle Enable Events to On
- Add bot events:
message.channels(public channels)message.groups(private channels)message.im(direct messages)
- Click Save Changes
Add OAuth scopes
- Go to OAuth & Permissions
- Add these Bot Token Scopes:
chat:write(send messages)channels:history(read public channels)groups:history(read private channels)im:history(read DMs)channels:read(list channels)groups:read(list private channels)users:read(look up display names)
Configuration
Environment variables
Add to.env:
Token reference
| Token | Prefix | Where to find it |
|---|---|---|
| Bot User OAuth Token | xoxb- | OAuth & Permissions → Bot User OAuth Token |
| App-Level Token | xapp- | Basic Information → App-Level Tokens |
Sync to container
Build and restart
Adding bot to channels
The bot only receives messages from channels it has been explicitly added to.
Repeat for each channel you want the bot to monitor.
Registering channels
Get channel ID
Option A - From URL: Open the channel in Slack on the web. The URL looks like:C0123456789 part is the channel ID.
Option B - Right-click:
Right-click the channel name → Copy link → extract the C... ID from the URL
Option C - Via API:
Register the channel
The JID format isslack: followed by the channel ID.
For your main channel (responds to all messages):
Testing the connection
Send a message in your registered Slack channel:- For main channel: Any message works
- For non-main channels: Include your trigger pattern (e.g.,
@Andy hello)
Check logs
JID format
Slack channels use theslack: prefix:
- Public channel:
slack:C0123456789 - Private channel:
slack:G0123456789 - Direct message:
slack:D0123456789
Channel types
The Slack integration supports:- Public channels - Bot must be added to the channel
- Private channels - Bot must be invited to the channel
- Direct messages - Users can DM the bot directly
- Multi-channel - Can monitor multiple channels simultaneously
Implementation details
The Slack channel implements theChannel interface using Socket Mode:
Troubleshooting
Bot not responding
Bot not responding
Check these items:
- Both tokens are set in
.envAND synced todata/env/env - Channel is registered:
- For non-main channels: message must include trigger pattern
- Service is running:
Bot not receiving messages
Bot not receiving messages
Verify these settings:
- Socket Mode is enabled (Slack app settings)
- Bot is subscribed to correct events:
message.channelsmessage.groupsmessage.im
- Bot has been added to the channel
- Bot has required OAuth scopes
Missing scope errors
Missing scope errors
If logs show
missing_scope errors:- Go to OAuth & Permissions in Slack app settings
- Add the missing scope listed in the error
- Reinstall the app to workspace (scope changes require reinstall)
- Copy the new Bot Token (it changes on reinstall)
- Update
.envand sync:cp .env data/env/env - Restart:
launchctl kickstart -k gui/$(id -u)/com.nanoclaw
Wrong token used
Wrong token used
Verify token format:
- Bot tokens start with
xoxb- - App tokens start with
xapp-
Message formatting
Slack uses mrkdwn syntax, which differs from standard Markdown. NanoClaw includes a/slack-formatting container skill that provides the agent with a complete mrkdwn reference.
Key differences from standard Markdown:
*bold*instead of**bold**<url|text>instead of[text](url)•bullets instead of numbered lists- No
##headings — use*Bold text*instead :emoji:shortcodes for emoji
CLAUDE.md files so agents always have access to them, even without invoking the skill directly.
Known limitations
- Threads are flattened - Threaded replies appear as regular channel messages. Responses go to main channel, not back into threads.
- No typing indicator - Slack’s Bot API doesn’t expose a typing indicator endpoint.
- Naive message splitting - Long messages split at 4000 chars, may break mid-sentence.
- No file handling - Only text content is processed. File uploads and rich blocks are ignored.
- Unbounded metadata sync - Channel list pagination has no upper bound, may be slow in large workspaces.
Removing Slack
Since Slack was added via a git merge, you remove it by reverting the merge commit:Find the merge commit
abc1234 Merge remote-tracking branch 'upstream/skill/slack'.Next steps
Add Gmail
Add Gmail integration to your installation
Add Discord
Add Discord support to your installation
Skills system
Learn more about how skills work