> ## Documentation Index
> Fetch the complete documentation index at: https://kiro.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> DM your Kiro Crew agent from Slack with streaming replies, interactive tool approval, thread-scoped sessions, and bidirectional dashboard sync.

Slack is the most full-featured messaging channel. Every DM thread is an isolated session with streaming replies, interactive Block Kit approval buttons, file/image/voice handling, and bidirectional sync with the dashboard.

Slack connects outbound via **Socket Mode** — no public URL, no inbound webhooks. It works from any machine that can reach `slack.com`.

## Setup

### From the dashboard (recommended)

1. Open **Settings → Messaging Channels → Slack** in the dashboard
2. Click **Connect** — the panel shows a one-click URL to create the Slack app with all scopes pre-filled
3. Follow the guided steps: create the app, generate the App Token (Socket Mode → toggle OFF then ON → `connections:write` → Generate), install to workspace, copy the Bot Token
4. Paste both tokens and your Slack Member ID into the dashboard panel
5. Click **Save** — the gateway restarts and connects

The dashboard validates tokens immediately and shows a green status badge when connected.

### From the CLI

```bash
kirocrew manifest --url    # opens Slack's "Create New App" page with scopes pre-filled
kirocrew setup             # prompts for App Token, Bot Token, and Member ID
kirocrew doctor            # verify
kirocrew restart
```

Or write tokens directly to `~/.kiro/crew/.env`:

```
SLACK_APP_TOKEN=xapp-…
SLACK_BOT_TOKEN=xoxb-…
KIROCREW_OWNER_ID=U0…
```

**ℹ️ Info:** Your Member ID is per-workspace. If you install the app in a different workspace, use the ID from that workspace.

## Owner lock

The Slack gateway is locked to `KIROCREW_OWNER_ID`. Only your Slack Member ID can interact with the bot. Non-owner messages are silently dropped.

## Interactive tool approval

When a tool call needs approval, Block Kit buttons appear inline:

- **Approve** / **Reject** — racing with the dashboard (first wins)
- **Trust this command** — session-scoped, exact match
- **Trust this tool** — session-scoped, any args
- **YOLO** — global 30-min auto-approve

## Slash commands

| Command | Purpose |
|---|---|
| `/kirocrew dashboard [duration]` | Presigned dashboard link (default 1h, max 6h) |
| `/kirocrew yolo` | Toggle auto-approve |
| `/kirocrew agent [name]` | Show/switch active agent |
| `/kirocrew channels` | Channel management modal |
| `/kirocrew sessions` | List sessions with resume buttons |
| `/kirocrew help` | List all sub-commands |

The command name is configurable via `slack.command` (default: `kirocrew`).

## Bang commands (owner-only)

| Command | Purpose |
|---|---|
| `!dashboard [duration]` | Presigned dashboard link |
| `!yolo on\|off` | Toggle auto-approve |
| `!agent <name>\|off` | Switch/clear agent |
| `!ta <agent>\|off` | Thread-only agent override |
| `!stop` | Interrupt current turn |
| `!compact` | Compact session context |

## Keyword commands

| Command | Purpose |
|---|---|
| `status` | Runtime stats |
| `spawn <task>` / `bg <task>` | Subagent (blocking / fire-and-forget) |
| `spawn list` | List subagents |
| `cron list` / `cron remove <id>` | Manage crons |
| `sessions` | List recent sessions |
| `run <path>` | Run a task spec |

## Channel modes

Beyond DMs, Kiro Crew can join group channels in three modes:

| Mode | Behavior |
|---|---|
| `mention` | Respond only when @-mentioned; 50-msg rolling context (5-min TTL, in-memory) |
| `observe` | Silent unless @-mentioned; 200-msg context (1-week TTL, disk-persisted) |
| `off` | Ignore the channel |

Only messages from authorized users are recorded in observe mode.

## Dashboard ↔ Slack sync

The dashboard's **💬** button links a chat session to a Slack thread:

- A new thread appears with a summary of recent messages
- Messages sync bidirectionally in real time
- The `sessions` command lists recent sessions with **▶️ Resume** buttons

### Connect new sessions automatically

Turn on **Settings → Messaging Channels → Slack → Connect new sessions to Slack automatically** (`slack.auto_link_sessions`, off by default) to link new sessions without pressing the button. When Slack is connected, a persistent session you start in the dashboard gets a thread in your direct message with the bot after its first ordinary message, and the turn that message starts is mirrored there.

The automatic link covers only that case:

- A session whose first input runs as a slash command is never linked automatically.
- Sessions that start in Slack or another channel, sessions that run on a remote crew, incognito and temporary sessions, sessions created by an agent, a scheduled job, or an app, sessions that already have a thread, and sessions that existed before you turned the setting on are not linked.
- A failed attempt is not retried. Link the session with the **💬** button instead.
- Kiro Crew holds the first send for up to five seconds while the thread is created. If Slack takes longer, the thread is created afterward and receives only the turns that start after it exists; the first turn is not copied into it.
- A session linked this way stays where it is in the sidebar. Only conversations that start in Slack are filed as Slack sessions.

## Reactions

Phase-aware emoji reactions cover `queued`, `thinking`, `coding`, `browsing`, `tool`, `done`, and `error`. Customize:

```json
{
  "slack": {
    "reactions": { "done": "sparkle", "thinking": "brain" },
    "reactions_enabled": true
  }
}
```

Set a phase to `null` to suppress it. Set `reactions_enabled: false` to disable all.

## Files and images

- **Images** enter the session through the vision channel
- **Text and supported documents** are extracted within their type-specific limits
- **Voice memos** are transcribed automatically
- **Archives, video, SVG, and otherwise-unrecognized files** are downloaded as local files for the agent, up to the applicable opaque-file and Slack limits

A message can carry at most 10 attachments through the shared ingestion layer. A rejected file is reported rather than silently omitted.

## Edit a message the agent sent

The `update_message` tool replaces the text or Block Kit blocks of a Slack message that the Kiro Crew bot itself authored. Provide the channel ID and timestamp from the original `send_message` call, plus the replacement text or blocks.

The edit works in the owner's DM or in a channel listed in `slack.tracking_channels`. It cannot edit a message authored by any other user or bot. Replacement is whole-field: supplying only text removes existing blocks, and supplying only blocks removes existing text unless fallback text is included.

## Home Tab

Block Kit view with live system status, cron jobs, active sessions, and recent lessons.

## Configuration

Credentials in `~/.kiro/crew/.env`:

```
SLACK_APP_TOKEN=xapp-…
SLACK_BOT_TOKEN=xoxb-…
KIROCREW_OWNER_ID=U0…
```

Settings in `config.json`:

| Key | Default | Purpose |
|---|---|---|
| `slack.command` | `"kirocrew"` | Slash command name |
| `slack.auto_link_sessions` | `false` | Open a Slack thread for each new persistent dashboard session after its first message |
| `slack.reactions_enabled` | `true` | Phase emoji reactions |
| `slack.reactions` | (defaults) | Per-phase overrides |
| `slack.allowed_enterprise_ids` | `[]` | Enterprise Grid allowlist (empty = all) |

## Troubleshooting

| Problem | Fix |
|---|---|
| Install App button greyed out | Use Features → OAuth & Permissions → Install to Workspace |
| No events received | Verify Socket Mode ON, events subscribed, Home Tab enabled, reinstall |
| `missing_scope` error | Add scope, reinstall, re-run `kirocrew setup` |
| Bot doesn't respond | Check `kirocrew doctor`; confirm gateway running |
| Dashboard shows 403 | Token expired — `!dashboard` for a fresh link |
