Slack Integration
Connect aidaemon to your Slack workspace via Socket Mode for real-time messaging.
Pre-built Binaries
If you installed via the one-line script or Homebrew, Slack support is already included. Just configure
config.toml below. The feature flag is only needed when building from source.Create a Slack App
- Go to api.slack.com/apps and click Create New App
- Choose From scratch, name it (e.g., "aidaemon"), and select your workspace
- Under Socket Mode, enable it and generate an App-Level Token with the
connections:writescope — this is yourapp_token(xapp-...) - Under OAuth & Permissions, add these Bot Token Scopes:
channels:read— list members in public channelschat:write— send messagesfiles:read— download files sent by usersfiles:write— upload files to Slackgroups:read— list members in private channels (needed for resolving user names in private channels)im:read— read DM metadata (required for file transfers in direct messages)reactions:write— add status reactions (hourglass during processing)users:read— resolve user info
- Under Event Subscriptions, enable events and subscribe to:
message.channels— messages in public channelsmessage.groups— messages in private channelsmessage.im— direct messages
- Under App Home, scroll to Show Tabs and enable the Messages Tab. Check "Allow users to send Slash commands and messages from the messages tab" — without this, users cannot DM the bot.
- Install the app to your workspace — copy the Bot User OAuth Token (
xoxb-...)
Configuration
config.toml
[slack]
enabled = true
app_token = "xapp-1-..."
bot_token = "xoxb-..."
allowed_user_ids = ["U123456789"]
use_threads = true| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Enable the Slack channel |
app_token | string | — | App-Level Token for Socket Mode (xapp-...). Supports "keychain" and ${ENV}. |
bot_token | string | — | Bot User OAuth Token (xoxb-...). Supports "keychain" and ${ENV}. |
allowed_user_ids | array | [] | Slack user IDs allowed to interact. Empty = no restriction. |
use_threads | bool | true | Reply in threads by default. Each thread gets its own session context. |
Find Your Slack User ID
Click on your profile in Slack, then click More → Copy member ID. The format is U followed by alphanumeric characters (e.g., U0123ABCDEF).
Features
- Socket Mode — real-time WebSocket connection, no public URL required
- Threaded replies — configurable threaded conversations with per-thread session context
- File transfer — send and receive files through Slack
- Block Kit approvals — interactive buttons for terminal command approval
- Slash commands — same commands as Telegram (
/cost,/model,/tasks, etc.) - Status reactions — hourglass emoji while processing, removed on completion
- Markdown conversion — standard markdown automatically converted to Slack mrkdwn format
- Message chunking — long responses split to respect Slack’s 39KB message limit
- Auto-reconnect — exponential backoff on connection failure (5s → 60s max)
Session Model
Slack sessions are identified by channel and thread:
- Channel message:
slack:{channel_id} - Thread message:
slack:{channel_id}:{thread_ts}(whenuse_threadsis enabled)
Each session maintains its own conversation history, working memory, and facts context.
Access Control
If
allowed_user_ids is empty, anyone in the workspace who can message the bot can interact with it. Always set this in production.