messaging · diff
git:20260410.b9412d8 to git:20260410.4ef8b02
225 added, 62 removed. Audit A to A.
---
name: messaging
description: Set up a messaging channel (WhatsApp, Telegram, Discord, iMessage, Slack) to reach this agent from outside Claude Code. Triggers on /agent:messaging, "configurar whatsapp", "setup messaging", "conectar telegram", "agregar canal".
user-invocable: true
argument-hint: [platform]
---
# Set Up a Messaging Channel
- This skill connects your agent to a messaging platform so you can chat with it from your phone or desktop messaging apps.
+ Guide the user through installing a messaging plugin so they can reach this agent from their phone or desktop.
+ **IMPORTANT — architectural limitation**: The agent CANNOT execute `/plugin marketplace add` or `/plugin install` — these are REPL-only commands. This skill SHOWS the user the exact commands to run, and guides them through the flow.
+
## Available platforms
- | # | Platform | Marketplace | Notes |
- |---|---|---|---|
- | 1 | **WhatsApp** ⭐ | `crisandrews/claude-whatsapp` | Recommended. Rich access control, voice transcription. |
- | 2 | **Telegram** | `claude-plugins-official` | Official Bot API. Pairing-based access. |
- | 3 | **Discord** | `claude-plugins-official` | Threading, rich reactions, guild support. |
- | 4 | **iMessage** | `claude-plugins-official` | macOS only. Reads chat.db natively. |
- | 5 | **Slack** | `claude-plugins-official` | Workspace-based, OAuth. |
+ | # | Platform | Marketplace | Launch flag | Notes |
+ |---|---|---|---|---|
+ | 1 | **WhatsApp** ⭐ | `crisandrews/claude-whatsapp` | `--dangerously-load-development-channels` | Rich access control, voice transcription (Whisper local), Baileys (unofficial WhatsApp Web API). Not on official allowlist. |
+ | 2 | **Telegram** | `anthropics/claude-plugins-official` | `--channels` | Official Bot API, pairing. Requires Bun + claude.ai login. |
+ | 3 | **Discord** | `anthropics/claude-plugins-official` | `--channels` | Official Bot API, requires bot creation + Message Content Intent. |
+ | 4 | **iMessage** | `anthropics/claude-plugins-official` | `--channels` | macOS only. Reads chat.db directly, no token. Needs Full Disk Access. |
+ | 5 | **Fakechat** (demo) | `anthropics/claude-plugins-official` | `--channels` | Localhost UI for testing the channel flow. No real platform. |
+ **Note**: Slack is NOT a channel plugin. See [Claude in Slack](https://code.claude.com/docs/en/slack) for the different integration model.
+
+ **Prerequisites for official channels** (Telegram/Discord/iMessage/Fakechat):
+ - Claude Code v2.1.80 or later
+ - [Bun](https://bun.sh) installed
+ - claude.ai login (API key auth is NOT supported for channels)
+ - Team/Enterprise: admin must enable channels in managed settings
+
## Steps
- 1. **Ask the user** which platform they want (unless specified in the argument).
- Default recommendation: WhatsApp.
+ 1. **Ask the user** which platform (unless specified in the argument). Default recommendation: WhatsApp.
2. **Check if the plugin is already installed**:
```bash
ls ~/.claude/plugins/cache/ 2>/dev/null | grep -iE "whatsapp|telegram|discord|imessage|slack"
```
+ If already installed, skip to the relaunch step.
- 3. **Show the user the exact commands to run** in the Claude Code REPL. The agent CANNOT execute `/plugin marketplace add` or `/plugin install` — these are REPL-only commands. Just show them clearly:
+ 3. **Show the EXACT commands from the plugin's README** (do not invent or simplify):
- ### WhatsApp (crisandrews/claude-whatsapp)
+ ### WhatsApp — complete flow (from `crisandrews/claude-whatsapp` README)
+
+ **Prerequisites**: Node.js v18+
+
+ **Step 1 — Create a folder for the WhatsApp agent** (if not already in one):
+ ```sh
+ mkdir ~/my-whatsapp-agent && cd ~/my-whatsapp-agent
+ claude
```
+
+ **Step 2 — Install the plugin** (inside Claude Code):
+ ```
/plugin marketplace add crisandrews/claude-whatsapp
/plugin install whatsapp@claude-whatsapp
+ ```
+ When prompted for scope, select **"Install for you, in this repo only (local scope)"** — isolates the agent to this folder.
+
+ **Step 3 — Exit and relaunch with the channel flag**:
+ ```sh
/exit
```
- Then relaunch with the channels flag:
+ Then from the terminal:
```sh
- claude --dangerously-load-development-channels plugin:whatsapp@claude-whatsapp
+ claude --dangerously-load-development-channels plugin:whatsapp@claude-whatsapp --dangerously-skip-permissions
```
- Then in Claude Code:
+
+ **Flag explanation**:
+ - `--dangerously-load-development-channels plugin:whatsapp@claude-whatsapp` — loads the whatsapp channel plugin
+ - `--dangerously-skip-permissions` — agent executes tools without asking for confirmation (recommended for smooth WhatsApp flow, otherwise every reply would need approval)
+
+ **First launch**: installs dependencies in the background (~60-90 seconds). Wait for the "dependencies installed" notification.
+
+ **Step 4 — Scan the QR code**:
```
/whatsapp:configure
```
- Follow the QR code prompt.
+ Opens a QR code on screen. Scan from phone: WhatsApp → Settings → Linked Devices → Link a Device.
- ### Telegram (official)
+ Session is saved to `.whatsapp/auth/` — you won't scan again unless you log out.
+
+ **Step 5 — Pair** (first-time contact):
+ Message your own WhatsApp number from another phone. It replies with a 6-character code. Then in Claude Code:
```
- /plugin marketplace add anthropics/claude-plugins-official
+ /whatsapp:access pair <code>
+ ```
+
+ **Step 6 — Lock down access**:
+ ```
+ /whatsapp:access policy allowlist
+ ```
+ Now only approved contacts can reach the agent.
+
+ ### Optional: autonomous mode with web browsing
+ For an agent that doesn't ask permission and can browse the web:
+ ```sh
+ claude --dangerously-load-development-channels plugin:whatsapp@claude-whatsapp --dangerously-skip-permissions --chrome
+ ```
+ The `--chrome` flag enables browser automation (via claude-in-chrome MCP).
+
+ ### Optional: voice transcription
+ After the plugin is running:
+ ```
+ /whatsapp:configure audio
+ ```
+ Downloads local Whisper model (~77 MB) — no API keys needed, runs entirely on device.
+
+ Set language for better accuracy:
+ ```
+ /whatsapp:configure audio es
+ ```
+ Supported: `es`, `en`, `pt`, `fr`, `de`, `it`, `ja`, `zh`, `ko`, `ar`, `ru`, `hi`.
+
+ ### Optional: run as background service
+ See the README at https://github.com/crisandrews/claude-whatsapp for macOS launchd and Linux systemd examples.
+
+ ---
+
+ ---
+
+ ### Telegram (official — complete flow from https://code.claude.com/docs/en/channels)
+
+ **Prerequisites**: [Bun](https://bun.sh) installed (`bun --version` to verify). Claude Code v2.1.80+. claude.ai login (API key auth not supported for channels).
+
+ **Step 1 — Create a Telegram bot**:
+ 1. Open [@BotFather](https://t.me/BotFather) in Telegram, send `/newbot`
+ 2. Give it a display name and a unique username ending in `bot`
+ 3. Copy the token BotFather returns
+
+ **Step 2 — Install the plugin**:
+ ```
/plugin install telegram@claude-plugins-official
```
- Create a bot via @BotFather on Telegram, get the token, then:
+ If "plugin not found", run `/plugin marketplace update claude-plugins-official` (or `/plugin marketplace add anthropics/claude-plugins-official` if never added). Then retry.
+
+ After installing: `/reload-plugins` to activate the configure command.
+
+ **Step 3 — Configure the token**:
```
- /telegram:configure <your-bot-token>
+ /telegram:configure <token>
```
+ Saves to `~/.claude/channels/telegram/.env`. (Alternatively, set `TELEGRAM_BOT_TOKEN` in shell env before launching Claude Code.)
- ### Discord (official)
+ **Step 4 — Restart with channels enabled**:
+ ```sh
+ /exit
```
- /plugin marketplace add anthropics/claude-plugins-official
+ ```sh
+ claude --channels plugin:telegram@claude-plugins-official
+ ```
+
+ **Step 5 — Pair account**:
+ - Send any message to your bot on Telegram
+ - Bot replies with a pairing code
+ - In Claude Code:
+ ```
+ /telegram:access pair <code>
+ /telegram:access policy allowlist
+ ```
+
+ ---
+
+ ### Discord (official — complete flow from https://code.claude.com/docs/en/channels)
+
+ **Prerequisites**: Same as Telegram (Bun, v2.1.80+, claude.ai login).
+
+ **Step 1 — Create a Discord bot**:
+ 1. Go to [Discord Developer Portal](https://discord.com/developers/applications) → **New Application** → name it
+ 2. In **Bot** section: create username, click **Reset Token**, copy the token
+ 3. Scroll to **Privileged Gateway Intents** → enable **Message Content Intent**
+
+ **Step 2 — Invite the bot to your server**:
+ 1. Go to **OAuth2 → URL Generator**
+ 2. Select scope: `bot`
+ 3. Enable permissions: View Channels, Send Messages, Send Messages in Threads, Read Message History, Attach Files, Add Reactions
+ 4. Open the generated URL to add bot to your server
+
+ **Step 3 — Install the plugin**:
+ ```
/plugin install discord@claude-plugins-official
```
- Create a Discord bot, get the token, then:
+ Then `/reload-plugins`.
+
+ **Step 4 — Configure the token**:
```
- /discord:configure <your-bot-token>
+ /discord:configure <token>
```
+ Saves to `~/.claude/channels/discord/.env`.
- ### iMessage (official, macOS only)
+ **Step 5 — Restart with channels**:
+ ```sh
+ /exit
+ claude --channels plugin:discord@claude-plugins-official
```
- /plugin marketplace add anthropics/claude-plugins-official
+
+ **Step 6 — Pair account**:
+ - DM the bot on Discord
+ - Bot replies with pairing code
+ - In Claude Code:
+ ```
+ /discord:access pair <code>
+ /discord:access policy allowlist
+ ```
+
+ ---
+
+ ### iMessage (official, macOS only — from https://code.claude.com/docs/en/channels)
+
+ **Prerequisites**: macOS, Bun, Claude Code v2.1.80+, claude.ai login. No bot token or external service needed — reads Messages database directly, sends via AppleScript.
+
+ **Step 1 — Grant Full Disk Access**:
+ The Messages database at `~/Library/Messages/chat.db` is protected. On first launch, macOS prompts for access — click **Allow**. The prompt names the app that launched Bun (Terminal, iTerm, etc.).
+
+ If no prompt or you clicked "Don't Allow", grant manually: **System Settings → Privacy & Security → Full Disk Access** → add your terminal. Without this, server exits with `authorization denied`.
+
+ **Step 2 — Install the plugin**:
+ ```
/plugin install imessage@claude-plugins-official
```
- Requires granting Full Disk Access to Claude Code in System Settings → Privacy.
+ If "not found": `/plugin marketplace update claude-plugins-official` first.
- ### Slack (official)
+ **Step 3 — Restart with channels**:
+ ```sh
+ /exit
+ claude --channels plugin:imessage@claude-plugins-official
```
- /plugin marketplace add anthropics/claude-plugins-official
- /plugin install slack@claude-plugins-official
- /slack:configure
+
+ **Step 4 — Text yourself**:
+ - Open Messages on any device signed into your Apple ID
+ - Send a message to yourself — reaches Claude immediately (self-chat bypasses access control)
+ - On first reply: macOS prompts to let terminal control Messages → click **OK**
+
+ **Step 5 — Allow other senders** (optional):
```
- Follow the OAuth flow.
+ /imessage:access allow +15551234567
+ ```
+ Handles are phone numbers (`+country` format) or Apple ID emails (`user@example.com`).
+ ---
+
+ ### Slack
+
+ Slack is NOT in the official channels list. If the user wants Slack, direct them to:
+ - [Claude in Slack](https://code.claude.com/docs/en/slack) — different integration model, uses Claude web sessions instead of channels
+ - This is NOT a plugin — it's configured via Slack app + claude.ai settings
+ - Refer to the docs, don't try to install it as a plugin
+
+ ---
+
+ ### Fakechat (demo for testing)
+
+ For quick testing without setting up any real platform:
+ ```
+ /plugin install fakechat@claude-plugins-official
+ /exit
+ claude --channels plugin:fakechat@claude-plugins-official
+ ```
+ Opens a chat UI at http://localhost:8787 — type messages, Claude replies back. Good for verifying the channel flow before setting up WhatsApp/Telegram/etc.
+
## How it works with ClawCode
- **Both plugins coexist** — each is an independent MCP server. No conflicts.
- **Your personality applies** — when a message arrives, you respond as yourself (from SOUL.md + IDENTITY.md), not as a generic Claude.
- **Formatting is automatic** — each messaging plugin injects its own format rules (e.g., WhatsApp uses `*bold*`, not `**bold**`).
- **Memory is shared** — what the user tells you via WhatsApp is saved to `memory/YYYY-MM-DD.md` just like in terminal.
- ## Important
-
- - The agent CANNOT install plugins directly. Show the user the commands and explain they must run them.
- - After installing a messaging plugin, the user must restart Claude Code for it to connect.
- - Verify the installation with `/mcp` — both `clawcode` and the new plugin should appear.
- - For WhatsApp, the first connection requires scanning a QR code on the user's phone.
- - Access control is per-plugin — the user configures who can reach the agent via each plugin's `access` skill.
+ ## Verifying the setup
- ## After setup
+ After installing and relaunching:
- Tell the user:
- 1. Restart Claude Code with the appropriate channels flag
- 2. Run `/mcp` to verify both plugins are connected
- 3. Send a test message from their phone
- 4. The agent should respond with its personality (not generic Claude)
+ 1. Run `/mcp` — should show both `clawcode` and the messaging plugin as connected.
+ 2. Send a test message from your phone.
+ 3. The agent should respond with its personality (not generic Claude).
+ 4. Ask `/status` in the chat — should show the agent's identity card.
## Index conversation logs in memory (recommended)
Messaging plugins log conversations to disk. These logs are valuable context that the agent should be able to search. ClawCode can index them automatically via `memory.extraPaths` in `agent-config.json`.
**IMPORTANT**: Only index `.md` log files, NOT `.jsonl`. Most plugins (including claude-whatsapp) write both formats — indexing both would duplicate content.
### Known log locations
| Plugin | Log path | Format |
|---|---|---|
| claude-whatsapp (local scope) | `./.whatsapp/logs/conversations/` | `.md` + `.jsonl` |
| claude-whatsapp (user scope) | `~/.claude/channels/whatsapp/logs/conversations/` | `.md` + `.jsonl` |
- | telegram | `~/.claude/channels/telegram/logs/` (check) | varies |
- | discord | `~/.claude/channels/discord/logs/` (check) | varies |
### Enable log indexing
After the messaging plugin is installed, add its log directory to `agent-config.json`:
-
```
agent_config(
action='set',
key='memory.extraPaths',
- value='["~/.claude/channels/whatsapp/logs/conversations"]'
+ value='["./.whatsapp/logs/conversations"]'
)
```
- Or edit `agent-config.json` directly:
- ```json
- {
- "memory": {
- "backend": "builtin",
- "extraPaths": [
- "~/.claude/channels/whatsapp/logs/conversations"
- ]
- }
- }
- ```
-
- Then `/mcp` to reload. The next `memory_search` will find content from those conversations. Only `.md` files are indexed — `.jsonl` files are skipped to avoid duplicates.
+ Then `/mcp` to reload. Next `memory_search` will find content from those conversations. Only `.md` files are indexed.
Log entries appear in search results with `extra:` prefix, e.g. `extra:conversations/2026-04-09.md`.
+
+ ## Important reminders
+
+ - The agent cannot install plugins directly. Always show commands for the user to run.
+ - After installing a messaging plugin, the user MUST restart Claude Code with the `--dangerously-load-development-channels` flag.
+ - Verify with `/mcp` after relaunch.
+ - For WhatsApp, the first connection requires scanning a QR code — cannot be automated.
+ - Canonical reference: https://github.com/crisandrews/claude-whatsapp