Slack Gateway
clawzero connects to Slack via Socket Mode (WebSocket) and responds using the Web API.
Prerequisites
- Create a Slack app at api.slack.com/apps
- Enable Socket Mode in the app settings
- Generate an App-Level Token with
connections:writescope → this is yourSLACK_APP_TOKEN(xapp-...) - Under OAuth & Permissions, add the following bot scopes:
chat:writeapp_mentions:readchannels:historygroups:historyim:historympim:history
- Install the app to your workspace and copy the Bot User OAuth Token → this is your
SLACK_BOT_TOKEN(xoxb-...) - Under Event Subscriptions, subscribe to:
message.channelsmessage.groupsmessage.imapp_mention
Configuration
Environment variables
export SLACK_APP_TOKEN="xapp-1-..."
export SLACK_BOT_TOKEN="xoxb-..."
Config file
[gateway.slack]
app_token_env = "SLACK_APP_TOKEN"
bot_token_env = "SLACK_BOT_TOKEN"
Or with direct values:
[gateway.slack]
app_token = "xapp-1-..."
bot_token = "xoxb-..."
Running
# Slack only
clawzero gateway slack
# All configured gateways
clawzero gateway
Build
Slack support requires the slack feature flag:
cargo install --path . --features slack
Behavior
- Each Slack thread gets its own agent session
- The bot responds in-thread with streaming message updates
- Message updates are rate-limited to avoid Slack API throttling
- Reactions (emoji) indicate processing status