# Slack Comms

> Slack integration for team communication. Use when searching for context in channels, reading channel history, posting messages, or finding discussions about topics.

- Skill: `incidentfox/slack-comms` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add incidentfox/slack-comms`
- Raw SKILL.md: https://api.skillmd.com/api/skills/incidentfox/slack-comms/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: incidentfox (https://skillmd.com/u/incidentfox)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/incidentfox/slack-comms

---


# Slack Communications

## Authentication

Set the `SLACK_BOT_TOKEN` environment variable with your bot token (xoxb-*).

For search operations, set `SLACK_USER_TOKEN` with a user token (xoxu-*) — bot tokens cannot use Slack's search API.

---

## Available Scripts

All scripts are in `.claude/skills/slack-comms/scripts/`

### search_messages.py - Search Across Channels
> **Note**: Requires a Slack **user token** (xoxu-*), not a bot token. Bot tokens cannot use the search API.

```bash
python .claude/skills/slack-comms/scripts/search_messages.py --query SEARCH_QUERY [--count N]

# Examples:
python .claude/skills/slack-comms/scripts/search_messages.py --query "refund policy"
python .claude/skills/slack-comms/scripts/search_messages.py --query "in:#support billing error"
python .claude/skills/slack-comms/scripts/search_messages.py --query "from:@jane onboarding" --count 30
```

### get_channel_history.py - Read Channel Messages
```bash
python .claude/skills/slack-comms/scripts/get_channel_history.py --channel CHANNEL_ID [--limit N]

# Examples:
python .claude/skills/slack-comms/scripts/get_channel_history.py --channel C123ABC456
python .claude/skills/slack-comms/scripts/get_channel_history.py --channel C123ABC456 --limit 100
```

### post_message.py - Post Messages
```bash
python .claude/skills/slack-comms/scripts/post_message.py --channel CHANNEL_ID --text MESSAGE [--thread THREAD_TS]

# Examples:
python .claude/skills/slack-comms/scripts/post_message.py --channel C123ABC456 --text "Here's the answer to your question"
python .claude/skills/slack-comms/scripts/post_message.py --channel C123ABC456 --text "Follow-up details" --thread 1705320123.456789
```

---

## Slack Search Operators

| Operator | Example | Purpose |
|----------|---------|---------|
| `in:#channel` | `in:#support` | Search specific channel |
| `from:@user` | `from:@jane` | Messages from a user |
| `has:reaction` | `has::eyes:` | Messages with reactions |
| `after:date` | `after:2024-01-15` | After a date |
| `before:date` | `before:2024-01-16` | Before a date |

---

## Common Workflows

### 1. Find Context on a Topic

```bash
# Step 1: Search for discussions about a topic
python search_messages.py --query "authentication flow"

# Step 2: Check a specific channel for recent activity
python get_channel_history.py --channel C_ENGINEERING --limit 50
```

### 2. Search for Prior Answers

```bash
python search_messages.py --query "in:#helpdesk how to reset password"
```

### 3. Cross-Channel Research

```bash
# Search support channel
python search_messages.py --query "in:#support billing error"

# Search engineering channel
python search_messages.py --query "in:#engineering billing service"
```

---

## Quick Commands Reference

| Goal | Command |
|------|---------|
| Search messages | `search_messages.py --query "topic"` |
| Channel history | `get_channel_history.py --channel C123ABC` |
| Post message | `post_message.py --channel C123ABC --text "Update"` |
| Reply to thread | `post_message.py --channel C123ABC --text "..." --thread TS` |

---

## Finding Channel IDs

- Channel IDs look like `C123ABC456`
- Get them from channel settings or by right-clicking → "Copy link"

---

## Best Practices

### Searching
- **Be specific**: Use channel filters (`in:#channel`) to reduce noise
- **Use operators**: Combine `from:`, `after:`, `has:` for precision
- **Check multiple channels**: Topics might be discussed across channels

### Posting
- **Use threads**: Keep replies in threads, not the main channel
- **Be concise**: People scan messages quickly

