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
CLI

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
All reasons and checks

stablyai/agent-slack

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/agent-slack

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad 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 it

Limitations

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.

CLI tools

An MCP server for Slack: channel history, threads, DMs, search and unreads, with posting off by default

MCP serverBroad access1.9KRepository stars
Official

Slack export without admin rights and a local MCP server: the agent analyzes your messages, threads, files and users

MCP serverExtended access2.8KRepository stars

Lark CLI

lark-cli

Official

The official Lark and Feishu CLI with agent skills: messages, docs, sheets, calendar, mail and tasks from the terminal, over 200 commands

CLIBroad access17.8KRepository stars
Official

Official agent skills and CLI for the Pachca corporate messenger: messages, chats, users, bots, tasks and search

SkillBroad access11Repository stars

An Obsidian plugin that runs Claude Code, Codex and other agents via the Agent Client Protocol right inside your notes vault

PluginBroad access2.5KRepository stars

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

SkillBroad access2.9KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
agent-slack (this entry)no562
Slack MCP Servernokey is optional1,871a Slack MCP server with writing off by default, connected to the client over MCP
Slackdumpyesnot required2,835exports 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.

README badge

Report a problem

Foxx AIagent-slack
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.