/slack:listen-slackfrom slack
Posts a Slack message and waits for a human reply in its thread without consuming model tokens. Uses a shell loop to poll for replies, marking messages with :ear: while listening and :eyes: when picked up.
Ships in slack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Lets an agent post an update into Slack and then wait for the human's reply in that message's thread without spending a model token while it waits. The waiting is a shell loop: it polls the thread, and the moment a human replies it marks the reply seen, exits, and prints the reply — so a harness that wakes the agent when a background command exits brings the agent back with the answer in hand.
The human sees the state on the message itself:
No :ear: means nobody is listening; a reply posted then waits until the agent listens again.
The script needs a Slack token that can post, react and read channel history, plus curl, jq, and flock or perl (macOS ships perl). The recommended token is a bot token (xoxb-…) on the same Slack app that owns the notify webhook. The plugin README walks through the scopes, reinstall and channel invite; it is at ${CLAUDE_PLUGIN_ROOT}/README.md — Codex: substitute the installed plugin directory for that token.
Every setting is named for a role, like notify-slack's webhooks: --to agent-notifications reads
SLACK_LISTEN_TOKEN_AGENT_NOTIFICATIONS=xoxb-…, or SLACK_LISTEN_TOKEN_OP_REF_AGENT_NOTIFICATIONS="op://…" (1Password; resolved with op read at call time — with several 1Password accounts signed in, also set SLACK_LISTEN_TOKEN_OP_ACCOUNT_AGENT_NOTIFICATIONS to the account that holds it, or OP_ACCOUNT), andSLACK_LISTEN_CHANNEL_AGENT_NOTIFICATIONS=C… — the channel id to post in and listen on (--channel overrides it).--to is required and never falls back to another role: the role also keys the one-listener-at-a-time state below. The token reaches curl on stdin, never on the command line. It is read once per command (a running listener reuses it); for unattended runs a plain SLACK_LISTEN_TOKEN_<ROLE> avoids 1Password approval timeouts.
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/listen.sh" --check --to agent-notifications
One auth.test call plus a one-message read of the channel. It prints the identity, the scopes Slack reports for the token, any missing required scope (chat:write, reactions:write, channels:history) with the fix, and whether the channel is readable. It never posts or reacts.
Post and listen in the same command. post --listen posts the update, prints its ts and permalink, and starts listening on it in the same process. In Claude Code, run that command as a background Bash task (run_in_background: true): it costs nothing while it waits, and its exit wakes you.
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/listen.sh" post --to agent-notifications --listen --text-file /tmp/update.txt
A reply that lands before the listener's first read still counts: the baseline is the newest reply the script already delivered (the parent when none was), not the moment listening began.
The message rides a file or stdin, not argv, for the same reason as in notify-slack. Like notify-slack, a post from a Claude Code session with Remote Control on ends with an Open Claude session link back to that session (from $CLAUDE_CODE_BRIDGE_SESSION_ID), unless the text already links it; --no-session-link turns it off for one post. Slack markup is not Markdown — *bold*, <url|label>, no headings or tables; the collab-tools plugin's temp-draft skill carries the reference at references/slack-formatting.md.
To listen on a message posted earlier, pass its ts (or permalink):
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/listen.sh" listen --to agent-notifications 1763502924.627409
Options: --timeout (default 8h; accepts 90, 90s, 30m, 8h, 1d), --interval seconds between polls (default 20; conversations.replies is a Tier 3 method, roughly 50 calls a minute per workspace, so keep it at 10 or above when several listeners run), --since <ts> to set the baseline by hand, --dry-run to print the resolved settings without a request.
| Exit | Meaning | What to do |
|---|---|---|
0 | Human reply(ies) arrived — printed below the header, oldest first, each with user id and ts. :eyes: is on each one; the :ear: is off. | Act on the reply. To keep the conversation going, ack in the thread and listen again (below). |
3 | --timeout passed with no human reply. :ear: removed. | Post a follow-up or listen again with a longer timeout. |
4 | Stopped: a newer listener for the same role + channel took over, stop was run, or the process got SIGTERM/SIGINT/SIGHUP. The line says which. | If superseded, nothing — the newer listener owns the conversation. |
1 | Error (bad token, missing scope, bot not in the channel, bad ts). The message names the fix. | Fix it; a missing scope or invite is a setup step, not something to retry. |
Ack a reply in its thread with post --thread-ts, then listen on the parent again:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/listen.sh" post --to agent-notifications --thread-ts 1763502924.627409 'On it — will report back here.'
bash "$SKILL_DIR/scripts/listen.sh" listen --to agent-notifications 1763502924.627409
A reply the human sends while you compose the ack is not lost: the ack never moves the baseline, so the next listen delivers it at once.
The agent's own messages never wake it: anything with a bot_id (the bot token's posts, the notify webhook's posts) and anything post sent is excluded, and replies already marked :eyes: are not reported twice. With a user token, the agent's posts carry the human's own user id, so post journals each ts it sends to keep them apart; post through this script rather than by other means when listening with a user token.
Starting a listener for a role + channel stops the previous one first (SIGTERM; its :ear: comes off before the new one goes up). So posting a new update with --listen moves the listening to it — there is never more than one :ear: per role + channel, even when two listeners start at the same moment.
To stop listening without a new post:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/listen.sh" stop --to agent-notifications
SIGKILL cannot be trapped, so a kill -9'd listener leaves its :ear: up. The next listen or stop for that role + channel removes it. If a harness's task-stop leaves the :ear: behind, it sent SIGKILL — run stop. An :ear: whose removal Slack refused (network error, outage) stays on record the same way, and each later listen or stop retries it until it comes off.
The wake-on-exit pattern depends on the harness waking the agent when a background command finishes, which Claude Code's background Bash does. A Codex shell command runs in the foreground, so under Codex run listen with a --timeout that fits the command's time limit and treat exit 3 as "no reply yet".
read-slack if in doubt.Retry-After.What SKILL.md sets; muted values are Claude Code's defaults
Use when an agent should hear BACK from a human through Slack: - "post a status update and wait for my answer in the thread" - "ask me on Slack, I'll reply there", "check Slack for my reply before continuing" - "keep listening on Slack while I'm away", "stop listening on Slack" A one-way notification with no reply expected is the companion `notify-slack` skill (webhook, no read access); reading arbitrary Slack threads or searching is `read-slack`. This skill reads only the threads of messages it watches.
Three short reads, in order
npx claudepluginhub jtsternberg/claude-plugins --plugin slackOther plugins' skills for the same job
3 skills in this plugin
/notify-slackPost a message to Slack from the terminal via an incoming webhook — a completion notification, a progress update, a result summary, or a Block Kit message. Covers 'ping me on Slack when this finishes', 'post that summary to Slack', 'send this to the team channel'./read-slackRead Slack from the terminal via the Web API — fetch a thread or message from a pasted slack.com/archives URL, search workspace messages, or read a channel's recent history as plain text. Covers 'pull/read/quote/investigate this Slack thread' and 'search Slack for X'.