Skip to main content
The Add Slack skill installs Slack support in NanoClaw using Socket Mode (no public URL needed). It handles code installation, Slack app creation, authentication, and channel registration.

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

1

Invoke the skill

Run /add-slack in your NanoClaw context.
2

Create Slack app

Follow the detailed setup guide (see SLACK_SETUP.md):
  1. Create app at api.slack.com/apps
  2. Enable Socket Mode and generate App-Level Token (xapp-...)
  3. Subscribe to bot events: message.channels, message.groups, message.im
  4. Add OAuth scopes: chat:write, channels:history, groups:history, im:history, channels:read, groups:read, users:read
  5. Install to workspace and copy Bot Token (xoxb-...)
3

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/bolt dependency
  • Updates channel registry
4

Configure environment

The skill adds to .env:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token
5

Get channel ID

  1. Add the bot to a Slack channel
  2. Right-click channel → Copy link
  3. Extract channel ID from URL (the C... part)
  4. Format for NanoClaw: slack:C0123456789
6

Register channel

The skill registers the channel with:
  • Channel ID (format: slack:C0123456789)
  • Channel name
  • Trigger requirement (main vs. trigger-only)

What Changes

Files Created

  • src/channels/slack.ts - Slack channel implementation
  • src/channels/slack.test.ts - Unit tests (46 tests)
  • groups/slack_main/ - Main channel workspace (if registered as main)

Files Modified

  • package.json - Adds @slack/bolt dependency
  • src/channels/index.ts - Imports Slack channel
  • .env - Adds SLACK_BOT_TOKEN and SLACK_APP_TOKEN
  • data/env/env - Synced environment for container
  • .nanoclaw/state.yaml - Records skill application
  • store/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)

You: What's the weather?
Andy: [responds immediately]

Additional Channels (Trigger Required)

You: @Andy what's the weather?
Andy: [responds]

You: regular message
Andy: [no response]
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

  1. Check tokens in .env AND data/env/env
  2. Check channel is registered: sqlite3 store/messages.db "SELECT * FROM registered_groups WHERE jid LIKE 'slack:%'"
  3. For non-main channels: message must include trigger pattern
  4. Service is running: launchctl list | grep nanoclaw

Bot Connected But Not Receiving Messages

  1. Verify Socket Mode is enabled
  2. Verify bot subscribed to events: message.channels, message.groups, message.im
  3. Verify bot added to the channel
  4. Check OAuth scopes

”missing_scope” Errors

  1. Go to OAuth & Permissions in app settings
  2. Add the missing scope
  3. Reinstall the app to workspace
  4. Copy new Bot Token (changes on reinstall)
  5. Update .env and sync: mkdir -p data/env && cp .env data/env/env
  6. 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}'

Build docs developers (and LLMs) love