Slack
Connect Archon to Slack so you can interact with your AI coding assistant from any Slack workspace.
Prerequisites
Section titled “Prerequisites”- Archon server running (see Getting Started)
- A Slack workspace where you have permission to install apps
Overview
Section titled “Overview”Archon uses Socket Mode for Slack integration, which means:
- No public HTTP endpoints needed
- Works behind firewalls
- Simpler local development
- Not suitable for Slack App Directory (fine for personal/team use)
Step 1: Create a Slack App
Section titled “Step 1: Create a Slack App”- Go to Slack API Apps
- Log in if prompted
- Choose the workspace for your app
- Click Create New App
- Choose From scratch
- Enter:
- App Name: Any name (this is what you will use to @mention the bot)
- Workspace: Select your workspace
- Click Create App
Step 2: Enable Socket Mode
Section titled “Step 2: Enable Socket Mode”- In the left sidebar, click Socket Mode
- Toggle Enable Socket Mode to ON
- When prompted, create an App-Level Token:
- Token Name:
socket-mode - Scopes: Add
connections:write - Click Generate
- Token Name:
- Copy the token (starts with
xapp-) — this is yourSLACK_APP_TOKEN - Copy the token and put it in your
.envfile
Step 3: Configure Bot Scopes
Section titled “Step 3: Configure Bot Scopes”- In the left sidebar, click OAuth & Permissions
- Scroll down to Scopes > Bot Token Scopes
- Add these scopes to bot token scopes:
app_mentions:read— Receive @mention eventschat:write— Send and edit messages (coverschat.updateon the bot’s own messages)channels:history— Read messages in public channels (for thread context)channels:join— Allow bot to join public channelsgroups:history— Read messages in private channels (optional)im:history— Read DM history (for DM support)im:write— Send DMsim:read— Read DM history (for DM support)mpim:history— Read group DM history (optional)mpim:write— Send group DMsreactions:write— Add lifecycle reactions (🔄 / ✅ / ❌) to the triggering messagecommands— Required for the/archonand/archon-workflowslash commandsusers:read— Look up real names viausers.infofor user attribution. The adapter degrades gracefully if this scope is missing (real names won’t appear in the Archon DB, but messages still flow); a one-timeslack.users_info_missing_scopewarning surfaces the misconfiguration in the server log.
Step 4: Subscribe to Events
Section titled “Step 4: Subscribe to Events”- In the left sidebar, click Event Subscriptions
- Toggle Enable Events to ON
- Under Subscribe to bot events, add:
app_mention— When someone @mentions your botmessage.im— Direct messages to your botmessage.channels— Messages in public channels (optional, for broader context)message.groups— Messages in private channels (optional)
- Click Save Changes
Step 4b: Enable Interactivity
Section titled “Step 4b: Enable Interactivity”Interactive buttons (Approve / Reject / Cancel on workflow runs) ride the same Socket Mode connection — no public URL needed.
- In the left sidebar, click Interactivity & Shortcuts
- Toggle Interactivity to ON
- Leave the Request URL field blank — Socket Mode handles routing
- Click Save Changes
Step 4c: Register Slash Commands
Section titled “Step 4c: Register Slash Commands”Two slash commands give the team an alternative to @mention:
| Command | What it does |
|---|---|
/archon <message> | Talks to Archon in the current channel. Equivalent to @archon <message>. |
/archon-workflow <subcommand> | Direct workflow control. Supports list, status, run <name> <args>, approve <id> [comment], reject <id> [reason], abandon <id>, resume <id>. |
For each command:
- In the left sidebar, click Slash Commands
- Click Create New Command
- Fill in:
- Command:
/archon(or/archon-workflow) - Request URL: leave blank — Socket Mode handles routing
- Short Description: e.g. “Talk to Archon” or “Archon workflow control”
- Usage Hint: e.g.
<message>or<subcommand>
- Command:
- Save
Reinstall the app (Step 5) after adding scopes or commands so Slack issues a fresh token with the new permissions.
Step 5: Install to Workspace
Section titled “Step 5: Install to Workspace”- In the left sidebar, click Install App
- Click Install to Workspace
- Review the permissions and click Allow
- Copy the Bot User OAuth Token (starts with
xoxb-) — this is yourSLACK_BOT_TOKEN - Set the bot token in your
.envfile
Step 6: Set Environment Variables
Section titled “Step 6: Set Environment Variables”Add to your .env file:
SLACK_BOT_TOKEN=xoxb-your-bot-tokenSLACK_APP_TOKEN=xapp-your-app-tokenStep 7: Invite Bot to Channel
Section titled “Step 7: Invite Bot to Channel”- Go to the Slack channel where you want to use the bot
- Type
/invite @your-bot(your bot’s display name) - The bot should now respond to @mentions in that channel
Configure User Whitelist (Optional)
Section titled “Configure User Whitelist (Optional)”To restrict bot access to specific users:
- In Slack, go to a user’s profile > click ”…” > “Copy member ID”
- Add to environment:
SLACK_ALLOWED_USER_IDS=U01ABC123,U02DEF456When set, only listed user IDs can interact with the bot. When empty/unset, the bot responds to all users.
Configure Streaming Mode (Optional)
Section titled “Configure Streaming Mode (Optional)”SLACK_STREAMING_MODE=batch # batch (default) | streamFor streaming mode details, see Configuration.
@Mention in Channels
Section titled “@Mention in Channels”@your-bot /clone https://github.com/user/repoContinue Work in Thread
Section titled “Continue Work in Thread”Reply in the thread created by the initial message:
@your-bot /statusStart Parallel Work (Worktree)
Section titled “Start Parallel Work (Worktree)”@your-bot /worktree feature-branchDirect Messages
Section titled “Direct Messages”You can also DM the bot directly — no @mention needed:
/helpIn-Thread UX
Section titled “In-Thread UX”When a workflow runs in a Slack thread, Archon now:
- Adds 🔄 to your triggering message when the run starts, and swaps it for ✅ on completion or ❌ on failure / cancellation
- Posts a single status message in the thread that’s edited in place as DAG nodes start, complete, fail, or get skipped
- Renders approval gates as interactive Approve / Reject buttons in-thread — no need to leave Slack to resume a paused run
- Adds a Cancel button on the status message while the run is non-terminal, so anyone on the allowed user list can abandon a runaway run with a click
- Appends a small italic cost / token footer after direct-chat replies
(e.g.
_cost: $0.0234 · 12.4k tokens · stop: end_turn_) and on the final status message when a workflow completes - Annotates long responses split across multiple Slack messages with
_part i/n_footers so it’s clear they belong together
All clicks on Approve / Reject / Cancel run through the same
SLACK_ALLOWED_USER_IDS whitelist as inbound messages — unauthorized
clicks are silently dropped and logged.
Troubleshooting
Section titled “Troubleshooting”Bot Doesn’t Respond
Section titled “Bot Doesn’t Respond”- Check that Socket Mode is enabled
- Verify both tokens are correct in
.env - Check the app logs for errors
- Ensure the bot is invited to the channel
- Make sure you’re @mentioning the bot (not just typing)
“channel_not_found” Error
Section titled ““channel_not_found” Error”The bot needs to be invited to the channel:
/invite @your-bot“missing_scope” Error
Section titled ““missing_scope” Error”Add the required scope in OAuth & Permissions and reinstall the app.
Thread Context Not Working
Section titled “Thread Context Not Working”Ensure these scopes are added:
channels:history(public channels)groups:history(private channels)
Security Recommendations
Section titled “Security Recommendations”- Use User Whitelist: Set
SLACK_ALLOWED_USER_IDSto restrict bot access - Private Channels: Invite the bot only to channels where it’s needed
- Token Security: Never commit tokens to version control