Slack Skill - Messaging & Channels
Read, search, and send Slack messages. Access channels and DMs.
CRITICAL: Message Sending Confirmation Required
Before sending ANY message, you MUST get explicit user confirmation.
When the user asks to send a Slack message:
- First, show them the complete message details:
- Workspace (if multiple)
- Channel/User
- Message text (or thread context if replying)
- Ask: "Do you want me to send this message?"
- ONLY run the send command AFTER the user explicitly confirms
- NEVER send a message without this confirmation
First-Time Setup (~3 minutes)
1. Create a Slack App
- Go to Slack API Apps
- Click Create New App → From scratch
- Name it (e.g., "Claude Assistant") and select your workspace
- Click Create App
2. Add Bot Scopes
- In the sidebar, click OAuth & Permissions
- Scroll to Scopes → Bot Token Scopes
- Add these scopes:
channels:history- Read public channel messageschannels:read- List public channelschat:write- Send messagesgroups:history- Read private channel messagesgroups:read- List private channelsim:history- Read DM messagesim:read- List DMsim:write- Send DMsmpim:history- Read group DM messagesmpim:read- List group DMsusers:read- List userssearch:read- Search messages (optional)
3. Install to Workspace
- Scroll up to OAuth Tokens for Your Workspace
- Click Install to Workspace
- Review permissions and click Allow
- Copy the Bot User OAuth Token (starts with
xoxb-)
4. Save Token
Create the config file:
echo '{"default": {"token": "xoxb-YOUR-TOKEN-HERE", "workspace": "your-workspace"}}' > ~/.claude/skills/slack-skill/config.json
5. Add Bot to Channels
The bot must be invited to channels to read/send messages:
- In Slack, go to the channel
- Type
/invite @YourBotName
Commands
List Channels
python3 ~/.claude/skills/slack-skill/slack_skill.py channels [--workspace NAME]
List Users
python3 ~/.claude/skills/slack-skill/slack_skill.py users [--workspace NAME]
Read Channel Messages
python3 ~/.claude/skills/slack-skill/slack_skill.py read CHANNEL [--limit N] [--workspace NAME]
CHANNEL can be:
- Channel name:
#general - Channel ID:
C0XXXXXX - User for DM:
@username
Send Message (Requires Confirmation)
python3 ~/.claude/skills/slack-skill/slack_skill.py send CHANNEL --message "Your message" [--thread-ts TIMESTAMP] [--workspace NAME]
Arguments:
CHANNEL- Channel name (#general), ID, or user (@username)--message/-m- Message text (required)--thread-ts/-t- Reply in thread (optional)--workspace/-w- Use specific workspace
Search Messages
python3 ~/.claude/skills/slack-skill/slack_skill.py search "query" [--limit N] [--workspace NAME]
Get Thread
python3 ~/.claude/skills/slack-skill/slack_skill.py thread CHANNEL THREAD_TS [--workspace NAME]
User Info
python3 ~/.claude/skills/slack-skill/slack_skill.py user USERNAME_OR_ID [--workspace NAME]
Multi-Workspace Support
Add workspaces to ~/.claude/skills/slack-skill/config.json:
{
"default": {
"token": "xoxb-default-token",
"workspace": "main-workspace"
},
"work": {
"token": "xoxb-work-token",
"workspace": "company-workspace"
}
}
Use --workspace work to specify which workspace.
Examples
Check recent messages in #general
python3 ~/.claude/skills/slack-skill/slack_skill.py read "#general" --limit 10
Send a message to a channel
python3 ~/.claude/skills/slack-skill/slack_skill.py send "#engineering" -m "Build completed successfully!"
Reply in a thread
python3 ~/.claude/skills/slack-skill/slack_skill.py send "#general" -m "Thanks!" -t "1234567890.123456"
DM someone
python3 ~/.claude/skills/slack-skill/slack_skill.py send "@john" -m "Hey, quick question..."
Search for messages
python3 ~/.claude/skills/slack-skill/slack_skill.py search "deployment issue" --limit 20
Output
All commands output JSON for easy parsing.
Requirements
pip install slack_sdk
Security Notes
- Bot tokens don't expire but can be revoked from Slack app settings
- Token stored locally in
~/.claude/skills/slack-skill/config.json - Revoke access: Your Apps → Select app → Revoke All Tokens