Chat with Claude Code from Slack, Discord, or Telegram. Powered by the Claude Agent SDK.
Claude Code runs locally on your machine. This project bridges its capabilities to your favorite chat platforms, with streaming responses, multi-turn conversations, and a tool approval UI.
- Multi-platform — Slack, Discord, and Telegram (run one or all simultaneously)
- Streaming — Claude's responses update in real-time as tokens arrive
- Tool approval — Claude asks for permission before running tools (Bash, Edit, etc.) via interactive buttons
- Auto-approve — Configure read-only tools (Read, Grep, Glob) to skip manual approval
- Session management — Each thread is an independent Claude session with full conversation history
- Resume — Sessions persist across messages; Claude remembers the full context within a thread
- Node.js >= 18
- Claude Code CLI installed and logged in (
npm install -g @anthropic-ai/claude-code) - A bot token for at least one platform (Slack, Discord, or Telegram)
git clone <repo-url> claude-chat
cd claude-chat
npm install
cp .env.example .env
# Edit .env with your bot tokens
npm run devAll configuration is via environment variables (or .env file). At least one platform must be configured.
| Variable | Required | Description |
|---|---|---|
SLACK_BOT_TOKEN |
For Slack | Bot token (xoxb-...) |
SLACK_APP_TOKEN |
For Slack | App-level token for Socket Mode (xapp-...) |
SLACK_SIGNING_SECRET |
For Slack | Signing secret |
DISCORD_BOT_TOKEN |
For Discord | Bot token |
TELEGRAM_BOT_TOKEN |
For Telegram | Bot token from @BotFather |
| Variable | Default | Description |
|---|---|---|
DEFAULT_WORKING_DIR |
/tmp/claude-workspace |
Default working directory for Claude sessions |
SESSION_TIMEOUT_MS |
1800000 (30 min) |
Idle sessions are cleaned up after this duration |
STREAM_DEBOUNCE_MS |
1500 |
Debounce interval for streaming message updates |
MAX_MESSAGE_LENGTH_SLACK |
3000 |
Max message length for Slack |
MAX_MESSAGE_LENGTH_DISCORD |
1900 |
Max message length for Discord |
MAX_MESSAGE_LENGTH_TELEGRAM |
4000 |
Max message length for Telegram |
AUTO_APPROVE_TOOLS |
(empty) | Comma-separated tool names to auto-approve (e.g. Read,Grep,Glob) |
- Create a Slack app at api.slack.com/apps
- Enable Socket Mode (generates
SLACK_APP_TOKEN) - Add Bot Token Scopes:
chat:write,channels:history,groups:history,im:history,mpim:history - Subscribe to bot events:
message.channels,message.groups,message.im,message.mpim - Install the app to your workspace (generates
SLACK_BOT_TOKEN) - Copy
SLACK_SIGNING_SECRETfrom Basic Information
- Create an app at discord.com/developers/applications
- Go to Bot settings, enable Message Content Intent
- Copy the bot token
- Invite the bot to your server with permissions: Send Messages, Read Message History, Manage Messages
- Mention the bot (
@YourBot your question) or talk to it in a thread
- Message @BotFather on Telegram
- Create a new bot with
/newbot - Copy the bot token
- Start a chat with your bot and send messages directly
Just send a message in a channel where the bot is present:
- Slack — Send any message in a channel/DM; each thread becomes a session
- Discord — Mention the bot (
@Bot your question) or reply in an active thread - Telegram — Send a message directly to the bot
| Command | Description |
|---|---|
!cd <path> |
Change the working directory for the current session |
!sessions |
List available Claude Code sessions (from terminal or other sources) |
!resume <id> |
Resume a Claude Code session by ID (supports partial ID prefix match) |
!reset |
Reset the current session (clear conversation history) |
Commands use
!prefix because Slack reserves/for its own slash commands.
When Claude wants to run a tool (e.g. write a file, execute a shell command), it posts a message with Approve / Deny buttons. Click to allow or block the action.
To skip approval for safe tools, set:
AUTO_APPROVE_TOOLS=Read,Grep,Glob,LS
Supports wildcards: Bash* matches all Bash-related tools.
src/
├── platform/Platform.ts — Abstract interface for chat platforms
├── core/
│ ├── Session.ts — Claude SDK query lifecycle (platform-agnostic)
│ ├── SessionManager.ts — Session registry + expiry cleanup
│ └── StreamingUpdater.ts — Debounced message streaming
├── approval/
│ ├── ApprovalGate.ts — Promise-based pause/resume for tool approval
│ └── AutoApprovePolicy.ts — Rule engine for auto-approving tools
├── slack/ — Slack adapter (Bolt + Socket Mode)
├── discord/ — Discord adapter (discord.js)
├── telegram/ — Telegram adapter (Telegraf)
├── config.ts — Environment variable loading
└── index.ts — Entry point (starts enabled platforms)
npm run dev # Watch mode with hot reload
npm run build # Compile TypeScript
npm start # Run compiled outputMIT