Slack (socket mode)
Quick setup (beginner)
- Create a Slack app and enable Socket Mode.
- Create an App Token (
xapp-...) and Bot Token (xoxb-...). - Set tokens for Clawdbot and start the gateway.
Setup
- Create a Slack app (From scratch) in https://api.channels.slack.com/apps.
- Socket Mode → toggle on. Then go to Basic Information → App-Level Tokens → Generate Token and Scopes with scope
connections:write. Copy the App Token (xapp-...). - OAuth & Permissions → add bot token scopes (use the manifest below). Click Install to Workspace. Copy the Bot User OAuth Token (
xoxb-...). - Event Subscriptions → enable events and subscribe to:
message.*(includes edits/deletes/thread broadcasts)app_mentionreaction_added,reaction_removedmember_joined_channel,member_left_channelchannel_renamepin_added,pin_removed
- Invite the bot to channels you want it to read.
- Slash Commands → create
/clawdif you usechannels.slack.slashCommand. If you enable native commands, add one slash command per built-in command (same names as/help). Native defaults to off for Slack unless you setchannels.slack.commands.native: true(globalcommands.nativeis"auto"which leaves Slack off). - App Home → enable the Messages Tab so users can DM the bot.
channels.slack.accounts with per-account tokens and optional name. See gateway/configuration for the shared pattern.
Clawdbot config (minimal)
Set tokens via env vars (recommended):SLACK_APP_TOKEN=xapp-...SLACK_BOT_TOKEN=xoxb-...
History context
channels.slack.historyLimit(orchannels.slack.accounts.*.historyLimit) controls how many recent channel/group messages are wrapped into the prompt.- Falls back to
messages.groupChat.historyLimit. Set0to disable (default 50).
Manifest (optional)
Use this Slack app manifest to create the app quickly (adjust the name/command if you want).slash_commands entry per command you want to expose (matching the /help list). Override with channels.slack.commands.native.
Scopes (current vs optional)
Slack’s Conversations API is type-scoped: you only need the scopes for the conversation types you actually touch (channels, groups, im, mpim). See https://api.channels.slack.com/docs/conversations-api for the overview.Required scopes
chat:write(send/update/delete messages viachat.postMessage) https://api.channels.slack.com/methods/chat.postMessageim:write(open DMs viaconversations.openfor user DMs) https://api.channels.slack.com/methods/conversations.openchannels:history,groups:history,im:history,mpim:historyhttps://api.channels.slack.com/methods/conversations.historychannels:read,groups:read,im:read,mpim:readhttps://api.channels.slack.com/methods/conversations.infousers:read(user lookup) https://api.channels.slack.com/methods/users.inforeactions:read,reactions:write(reactions.get/reactions.add) https://api.channels.slack.com/methods/reactions.get https://api.channels.slack.com/methods/reactions.addpins:read,pins:write(pins.list/pins.add/pins.remove) https://api.channels.slack.com/scopes/pins:read https://api.channels.slack.com/scopes/pins:writeemoji:read(emoji.list) https://api.channels.slack.com/scopes/emoji:readfiles:write(uploads viafiles.uploadV2) https://api.channels.slack.com/messaging/files/uploading
Not needed today (but likely future)
mpim:write(only if we add group-DM open/DM start viaconversations.open)groups:write(only if we add private-channel management: create/rename/invite/archive)chat:write.public(only if we want to post to channels the bot isn’t in) https://api.channels.slack.com/scopes/chat:write.publicusers:read.email(only if we need email fields fromusers.info) https://api.channels.slack.com/changelog/2017-04-narrowing-email-accessfiles:read(only if we start listing/reading file metadata)
Config
Slack uses Socket Mode only (no HTTP webhook server). Provide both tokens:SLACK_BOT_TOKENSLACK_APP_TOKEN
messages.ackReaction +
messages.ackReactionScope. Use messages.removeAckAfterReply to clear the
ack reaction after the bot replies.
Limits
- Outbound text is chunked to
channels.slack.textChunkLimit(default 4000). - Media uploads are capped by
channels.slack.mediaMaxMb(default 20).
Reply threading
By default, Clawdbot replies in the main channel. Usechannels.slack.replyToMode to control automatic threading:
| Mode | Behavior |
|---|---|
off | Default. Reply in main channel. Only thread if the triggering message was already in a thread. |
first | First reply goes to thread (under the triggering message), subsequent replies go to main channel. Useful for keeping context visible while avoiding thread clutter. |
all | All replies go to thread. Keeps conversations contained but may reduce visibility. |
slack sendMessage).
Manual threading tags
For fine-grained control, use these tags in agent responses:[[reply_to_current]]— reply to the triggering message (start/continue thread).[[reply_to:<id>]]— reply to a specific message id.
Sessions + routing
- DMs share the
mainsession (like WhatsApp/Telegram). - Channels map to
agent:<agentId>:slack:channel:<channelId>sessions. - Slash commands use
agent:<agentId>:slack:slash:<userId>sessions (prefix configurable viachannels.slack.slashCommand.sessionPrefix). - Native command registration uses
commands.native(global default"auto"→ Slack off) and can be overridden per-workspace withchannels.slack.commands.native. Text commands require standalone/...messages and can be disabled withcommands.text: false. Slack slash commands are managed in the Slack app and are not removed automatically. Usecommands.useAccessGroups: falseto bypass access-group checks for commands. - Full command list + config: Slash commands
DM security (pairing)
- Default:
channels.slack.dm.policy="pairing"— unknown DM senders get a pairing code (expires after 1 hour). - Approve via:
clawdbot pairing approve slack <code>. - To allow anyone: set
channels.slack.dm.policy="open"andchannels.slack.dm.allowFrom=["*"].
Group policy
channels.slack.groupPolicycontrols channel handling (open|disabled|allowlist).allowlistrequires channels to be listed inchannels.slack.channels.
channels.slack.channels.<id> or channels.slack.channels.<name>):
allow: allow/deny the channel whengroupPolicy="allowlist".requireMention: mention gating for the channel.allowBots: allow bot-authored messages in this channel (default: false).users: optional per-channel user allowlist.skills: skill filter (omit = all skills, empty = none).systemPrompt: extra system prompt for the channel (combined with topic/purpose).enabled: setfalseto disable the channel.
Delivery targets
Use these with cron/CLI sends:user:<id>for DMschannel:<id>for channels
Tool actions
Slack tool actions can be gated withchannels.slack.actions.*:
| Action group | Default | Notes |
|---|---|---|
| reactions | enabled | React + list reactions |
| messages | enabled | Read/send/edit/delete |
| pins | enabled | Pin/unpin/list |
| memberInfo | enabled | Member info |
| emojiList | enabled | Custom emoji list |
Notes
- Mention gating is controlled via
channels.slack.channels(setrequireMentiontotrue);agents.list[].groupChat.mentionPatterns(ormessages.groupChat.mentionPatterns) also count as mentions. - Multi-agent override: set per-agent patterns on
agents.list[].groupChat.mentionPatterns. - Reaction notifications follow
channels.slack.reactionNotifications(usereactionAllowlistwith modeallowlist). - Bot-authored messages are ignored by default; enable via
channels.slack.allowBotsorchannels.slack.channels.<id>.allowBots. - Warning: If you allow replies to other bots (
channels.slack.allowBots=trueorchannels.slack.channels.<id>.allowBots=true), prevent bot-to-bot reply loops withrequireMention,channels.slack.channels.<id>.usersallowlists, and/or clear guardrails inAGENTS.mdandSOUL.md. - For the Slack tool, reaction removal semantics are in /tools/reactions.
- Attachments are downloaded to the media store when permitted and under the size limit.