agent-slack CLI
A Slack CLI and skill: the agent reads channels and threads and searches messages and files, and drafts or sends only when you ask
- 562 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Takes a session token from Slack Desktop or the browser and acts in Slack as you
- Can send, edit and delete messages, invite people, create channels and run Slack workflows
- Reads direct messages and channels, and the content lands in the model's context; safe mode `AGENT_SLACK_SAFE_MODE=1` limits the damage
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/agent-slackDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Takes a session token from Slack Desktop or the browser and acts in Slack as you
- Can send, edit and delete messages, invite people, create channels and run Slack workflows
- Reads direct messages and channels, and the content lands in the model's context; safe mode `AGENT_SLACK_SAFE_MODE=1` limits the damage
This is third-party code. Review the repository files before installing.
What it does
agent-slack is a TypeScript and Bun command-line program through which an agent works with Slack as you. It reads a message by link, a channel's history and a full thread, searches messages and files with filters, and shows unreads, channels and users. Attachments are downloaded to a local folder and the agent receives their paths. Write commands exist too: sending and thread replies, scheduled sends, editing and deleting messages, reactions, creating channels and inviting people, and working with Slack canvases through Markdown. `message compose` opens an editor in the browser where you edit the text and send it yourself, and `message draft` puts a draft in the Drafts section of your Slack client. Output is kept economical for language models: compact JSON with empty and null fields removed. Auth needs no tokens if Slack Desktop is installed, because the CLI reads its local data. The `AGENT_SLACK_SAFE_MODE=1` mode turns sending into a draft at the tool level and blocks editing and deleting.
Who it is for. For people who want Claude Code, Codex or Cursor to digest Slack conversations, find decisions in threads and prepare replies.
Good fit when
- You need task context from a Slack thread: the agent gets a link and reads the whole branch with attachments
- You need to find where an outage was discussed: channel and date search, for example `search all` with `--channel` and `--after`
- In the morning you want an overview of unreads across channels, direct messages and threads, sorted by mentions
- An agent prepares a reply while the send decision stays with you: a draft in Slack or an editor in the browser
- You need an incident channel created and participants invited by email or handle
Not a fit when
- You need a Slack MCP server connected with an app token: agent-slack is a CLI and uses your session's data
- You need real-time events and a bot replying in channels: the program runs one-off commands
- The workspace is on Enterprise Grid, where session-token automation can trip security anomaly detection: the author warns about this separately
- The agent must publish nothing without review and you cannot turn on safe mode
Example request
Read the thread behind this Slack link, find mentions of this outage in #alerts from last week and prepare a draft reply, but do not send itLimitations
Automatic auth works on macOS and Windows and reads Slack Desktop's local data, falling back to Chrome, Brave and Firefox on macOS. Importing from Brave and Chrome requires enabling «Allow JavaScript from Apple Events» in the developer menu. Alternatively you can set the `SLACK_TOKEN` and `SLACK_COOKIE_D` tokens or a regular `xoxb` or `xoxp` token.
The draft commands use Slack's internal undocumented methods, so their behavior may change without notice. On Enterprise Grid this use of a session token can trigger Slack's protection. External invites require Slack Connect permissions.
Search is more reliable with a channel specified: the channel's history and files are then scanned and filtered locally. Installing through npm requires Node 22.5 or newer. With several workspaces and a channel name you must pass `--workspace`.
How to disable. Remove the CLI with `npm uninstall -g agent-slack` if you installed through npm. Delete the skill folder from the agent's skills directory; downloaded attachments sit in `~/.agent-slack/tmp/downloads/` on macOS. To cut off a workspace, revoke the session in Slack settings.
FAQ
How do I install agent-slack for Claude Code?
Install the CLI first: `curl -fsSL https://raw.githubusercontent.com/stablyai/agent-slack/main/install.sh | sh` (the recommended Bun route) or `npm i -g agent-slack`. Then add the skill with `npx skills add stablyai/agent-slack`: it lives in skills/agent-slack and suits Claude Code, Codex and Cursor.
Do I need to create a Slack app and a token?
On macOS and Windows you do not: the CLI takes data from the local Slack Desktop without quitting the app. If that fails it tries Chrome, Brave and Firefox. You can also set tokens by hand through `SLACK_TOKEN` and `SLACK_COOKIE_D`, or use a regular `xoxb` or `xoxp` token.
How do I stop the agent sending a message without review?
Turn on safe mode: `export AGENT_SLACK_SAFE_MODE=1` or the `--safe-mode` flag. Then `message send` is redirected to the draft editor and `message edit` and `message delete` are blocked. Reading, search and reactions work as usual.
How does message compose differ from message draft?
`message compose` opens an editor in the browser where you format and send the message yourself. `message draft` creates a draft in the Drafts section of your Slack client, from where you can send it from phone or desktop. In CI `compose` sends the supplied text at once, so use `draft` for review-only requests.
What can search do and where do files go?
Search covers messages and files with filters by channel, user and dates. Attachments from `message get` and `message list` are downloaded automatically, on macOS to `~/.agent-slack/tmp/downloads/`, and the agent gets local paths and reads snippets as `.txt` and images as `.png`.
Discussion
No questions or reviews yet.
Related
CLI toolsAn MCP server for Slack: channel history, threads, DMs, search and unreads, with posting off by default
Slack export without admin rights and a local MCP server: the agent analyzes your messages, threads, files and users
Lark CLI
lark-cli
The official Lark and Feishu CLI with agent skills: messages, docs, sheets, calendar, mail and tasks from the terminal, over 200 commands
Pachca API skills and CLI
Пачка API
Official agent skills and CLI for the Pachca corporate messenger: messages, chats, users, bots, tasks and search
Agent Client for Obsidian
Agent Client
An Obsidian plugin that runs Claude Code, Codex and other agents via the Agent Client Protocol right inside your notes vault
Claude-to-IM
claude-to-im
A bridge between Claude Code or Codex and messengers: talk to the agent from Telegram, Discord, Feishu, QQ or WeChat
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| agent-slack (this entry) | no | 562 | ||
| Slack MCP Server | no | key is optional | 1,871 | a Slack MCP server with writing off by default, connected to the client over MCP |
| Slackdump | yes | not required | 2,835 | exports Slack to files without admin rights, with a local MCP server |
README in short
The README opens with three principles: token-efficient output, zero-config auth through Slack Desktop and a human in the loop where it matters. It then covers install routes, a feature overview, the command map, an auth section and examples of reading, search, drafts, sending, scheduling and managing channels and canvases. Safe mode, where nothing is published without human review, is described separately.