What It Does
The Add Slack skill:- Installs Slack channel code and dependencies
- Guides through Slack app creation and OAuth setup
- Configures Socket Mode for local connectivity
- Registers Slack channels (public, private, or DM)
- Verifies connection and provides testing instructions
Prerequisites
- NanoClaw base installation complete
- Slack workspace admin access (to install apps)
- Ability to create Slack apps at api.slack.com
How to Apply
Create Slack app
Follow the detailed setup guide (see
SLACK_SETUP.md):- Create app at api.slack.com/apps
- Enable Socket Mode and generate App-Level Token (
xapp-...) - Subscribe to bot events:
message.channels,message.groups,message.im - Add OAuth scopes:
chat:write,channels:history,groups:history,im:history,channels:read,groups:read,users:read - Install to workspace and copy Bot Token (
xoxb-...)
Apply code changes
The skill runs
npx tsx scripts/apply-skill.ts .claude/skills/add-slack which:- Adds
src/channels/slack.ts - Adds unit tests (46 tests)
- Installs
@slack/boltdependency - Updates channel registry
Get channel ID
- Add the bot to a Slack channel
- Right-click channel → Copy link
- Extract channel ID from URL (the
C...part) - Format for NanoClaw:
slack:C0123456789
What Changes
Files Created
src/channels/slack.ts- Slack channel implementationsrc/channels/slack.test.ts- Unit tests (46 tests)groups/slack_main/- Main channel workspace (if registered as main)
Files Modified
package.json- Adds@slack/boltdependencysrc/channels/index.ts- Imports Slack channel.env- AddsSLACK_BOT_TOKENandSLACK_APP_TOKENdata/env/env- Synced environment for container.nanoclaw/state.yaml- Records skill applicationstore/messages.db- Adds registered channel entries
Dependencies Added
@slack/bolt- Slack Bolt framework for JavaScript
Usage
Channel Types Supported
- 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 run alongside WhatsApp or other channels
Main Channel (No Trigger Required)
Additional Channels (Trigger Required)
Slack uses Socket Mode which doesn’t require a public URL or webhook endpoint. The bot connects to Slack from behind your firewall.
Known Limitations
- Threads are flattened - Threaded replies appear as channel messages. Responses go to the channel, not back into the thread.
- No typing indicator - Slack Bot API doesn’t expose typing indicator endpoints.
- Message splitting is naive - Long messages split at 4000 characters, may break mid-sentence.
- No file/image handling - Only text content is processed.
- Channel metadata sync is unbounded - Workspaces with thousands of channels may experience slow startup.
Troubleshooting
Bot Not Responding
- Check tokens in
.envANDdata/env/env - Check channel is registered:
sqlite3 store/messages.db "SELECT * FROM registered_groups WHERE jid LIKE 'slack:%'" - For non-main channels: message must include trigger pattern
- Service is running:
launchctl list | grep nanoclaw
Bot Connected But Not Receiving Messages
- Verify Socket Mode is enabled
- Verify bot subscribed to events:
message.channels,message.groups,message.im - Verify bot added to the channel
- Check OAuth scopes
”missing_scope” Errors
- Go to OAuth & Permissions in app settings
- Add the missing scope
- Reinstall the app to workspace
- Copy new Bot Token (changes on reinstall)
- Update
.envand sync:mkdir -p data/env && cp .env data/env/env - Restart:
launchctl kickstart -k gui/$(id -u)/com.nanoclaw
Getting Channel ID
- Desktop: Right-click channel → Copy link → extract
C...ID - Web: URL shows
https://app.slack.com/client/TXXXXXXX/C0123456789 - API:
curl -s -H "Authorization: Bearer $SLACK_BOT_TOKEN" "https://slack.com/api/conversations.list" | jq '.channels[] | {id, name}'