Slack App Installation Guide
Connect CrewX to your Slack workspace in a few simple steps.
Quick Start
Using crewx-quickstart (recommended):
npx crewx-quickstart
This creates:
crewx.yaml- Agent configuration.env.slack- Environment variables templatestart-slack.sh- Quick launch script for Slack botslack-app-manifest.yaml- Pre-configured Slack app settings
After running this:
- Follow the Slack App Setup below to get your credentials
- Fill in
.env.slackwith your tokens - Run
./start-slack.shto start the bot
Slack App Setup
You'll need three Slack credentials:
- Bot User OAuth Token (
xoxb-…) - App-Level Token (
xapp-…) - Signing Secret
Choose one of two setup methods:
Method 1: Using Manifest (Quick)
- Go to Slack App dashboard
- Click Create New App → From an app manifest
- Choose your workspace and paste contents of
slack-app-manifest.yaml - Click Create - scopes and events are pre-configured
- Skip to Get Credentials section
Method 2: Manual Setup
Step 1: Create the Slack App
- Visit https://api.slack.com/apps.
- Click Create New App.
- Choose From scratch.
- Enter
CrewXas the App Name. - Select the target workspace.
- Click Create App.
Step 2: Add Bot Token scopes ⚡
Important: Scopes must be configured before you can install the app and receive tokens.
-
In the left sidebar, open OAuth & Permissions.
-
Scroll to the Scopes section.
-
Under Bot Token Scopes, click Add an OAuth Scope.
-
Add each of the following scopes individually:
Scope Purpose app_mentions:readRead messages when the bot is mentioned chat:writeSend messages as the bot channels:historyRead channel messages (thread history) channels:readView channel metadata reactions:writeAdd emoji reactions (bot status indicators) reactions:readRead existing reactions im:historyRead direct message history groups:historyRead private channel history (optional)
✅ Make sure all scopes are added before proceeding.
Why reactions are required?
The bot reacts with 👀 while it is processing a request, ✅ on success, and ❌ on errors so that the channel can see status updates at a glance.
Why history scopes are required?
channels:historyis necessary to reconstruct thread context.im:historyenables the same behaviour inside direct messages.
Step 3: Enable Socket Mode 🔌
- In the sidebar, open Socket Mode.
- Toggle Enable Socket Mode to On.
- When prompted:
- Enter
crewx-socketas the token name. - Click Add Scope, choose
connections:write, then click Generate.
- Enter
- Copy the generated App-Level Token (
xapp-…) and store it securely.You will not be able to view it again later.
Example: xapp-1-A01234567-1234567890123-abcdefghijklmnop
Step 4: Configure Event Subscriptions 📡
-
In the sidebar, open Event Subscriptions.
-
Toggle Enable Events to On.
-
Scroll to Subscribe to bot events and click Add Bot User Event.
-
Add the following events:
Event Purpose app_mentionTrigger when someone mentions @crewx message.channelsListen to channel messages (optional) -
Click Save Changes.
Step 5: Install the app to your workspace 🏢
- Open Install App in the sidebar.
- Click Install to Workspace.
- Review the requested permissions (message access, channel info, send messages).
- Click Allow.
- Copy the Bot User OAuth Token (
xoxb-…) displayed after installation.
Example: xoxb-XXXXXXXXXXXX-XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXX
Step 6: Collect the Signing Secret 🔐
- Navigate to Basic Information.
- Under App Credentials, locate Signing Secret.
- Click Show, copy the value, and store it in your secrets manager.
Keep all three credentials (
xoxb,xapp,Signing Secret) secure. They will be stored in a local environment file shortly.
Configuration
Environment Variables
Create a .env.slack file in the project root:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-level-token
SLACK_SIGNING_SECRET=your-signing-secret
# Optional overrides
SLACK_LOG_LEVEL=info
SLACK_MAX_RESPONSE_LENGTH=400000
Do not commit this file to source control.
Run the Bot
After the environment variables are in place, start the Slack bot:
# Build once (if you have not already)
npm run build
# Default: query-only mode with the Claude agent
source .env.slack && crewx slack
# Allow agents to perform execute tasks (file changes, migrations, etc.)
source .env.slack && crewx slack --mode execute
# Mention-Only mode: Bot only responds when @mentioned
source .env.slack && crewx slack --mention-only
# Switch the default agent
source .env.slack && crewx slack --agent gemini
source .env.slack && crewx slack --agent copilot
# Enable verbose logging
source .env.slack && crewx slack --log
source .env.slack && crewx slack --agent gemini --log
You should see:
⚡️ CrewX Slack Bot is running!
📱 Socket Mode: Enabled
🤖 Using default agent for Slack: claude
⚙️ Slack bot mode: query
Usage Options
Mention-Only Mode
By default, CrewX responds to all messages in channels. Mention-Only mode changes this so the bot only responds when @mentioned.
When to Use
Use Mention-Only when:
- Bot is in busy channels where not all messages need AI responses
- You want to reduce noise and token usage
- Team prefers opt-in AI assistance
- Bot shares space with other bots or workflows
Use Default mode when:
- Dedicated AI assistance channels
- Small team channels where AI context is always helpful
- You want seamless, always-available AI support
How It Works
Default Mode (Always Listening):
User: "How do I implement authentication?"
Bot: 🤖 [Responds automatically]
Mention-Only Mode:
User: "How do I implement authentication?"
Bot: [No response]
User: "@crewx How do I implement authentication?"
Bot: 🤖 [Responds when mentioned]
Starting in Mention-Only Mode
# Query mode with mention-only
source .env.slack && crewx slack --mention-only
# Execute mode with mention-only
source .env.slack && crewx slack --mode execute --mention-only
# With specific agent
source .env.slack && crewx slack --agent gemini --mention-only
Direct Messages
Mention-Only mode does not affect direct messages. The bot always responds to DMs regardless of this setting:
# DMs always work in both modes
[Direct message to @crewx]
User: "Help me debug this error"
Bot: 🤖 [Always responds in DMs]
Comparison
| Feature | Default Mode | Mention-Only Mode |
|---|---|---|
| Channel messages | All messages | Only @mentions |
| Thread replies | All messages in thread | Only when @mentioned |
| Direct messages | ✅ Responds | ✅ Responds |
| Token usage | Higher (all messages) | Lower (opt-in only) |
| Best for | Dedicated AI channels | Busy multi-purpose channels |
Tips
- Choose mode per workspace - Different Slack workspaces may need different modes
- Combine with channels - Use default mode in
#ai-helpchannel, mention-only in#general - Team preference - Ask your team which mode they prefer
- Test both - Try each mode to see what fits your workflow
Testing
Test your setup:
- Invite the bot to a channel:
/invite @crewx - Send a message:
@crewx Hello! What can you help me with? - The bot should reply in-thread ✔️
Troubleshooting
Bot is not responding
- Confirm the bot was invited to the channel (
/invite @crewx). - Verify all three tokens and ensure there are no leading/trailing spaces.
- Ensure Socket Mode is enabled on https://api.slack.com/apps.
- Confirm that
app_mentionand any other required events are subscribed.
“Missing Scope” errors
The bot is missing permissions. Return to Step 2 and confirm every scope is present:
app_mentions:readchat:writechannels:historychannels:readreactions:writereactions:readim:historygroups:history(optional)
After adding scopes, reinstall the app:
- Open OAuth & Permissions.
- Click Install App → Reinstall to Workspace.
- Approve the updated scope list.
Thread context is missing
- Ensure the history scopes (
channels:history,im:history) are present. - Reinstall the app after adding new scopes to refresh the permission grant.
View detailed logs
source .env.slack && crewx slack --log-level debug
Next Steps
- CLI Commands - Learn all CrewX commands
- Agent Configuration - Customize your agents
- Introduction - Learn more about CrewX
Security
Important:
- Never commit
.env.slackto source control - Do not share tokens in public channels or repositories
- Rotate credentials immediately if leaked at Slack App dashboard
You're all set! 🎉 CrewX is ready to work inside Slack.