Slack bot that bridges Slack conversations to Claude Code sessions. Each channel gets a persistent working directory and Claude Code session with full shell access and Slack MCP tools.
-
Install dependencies
npm install -
Configure environment — copy
.env.exampleor create.env:SLACK_BOT_TOKEN=xoxb-... SLACK_APP_TOKEN=xapp-... SLACK_SIGNING_SECRET=... ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... # for Whisper audio transcription -
Slack app setup — import
slack-manifest.jsoninto your Slack app config. The app needs Socket Mode enabled and the scopes listed in the manifest.
~/manage.sh slack start # start in background with logging
~/manage.sh slack stop # stop the service
~/manage.sh slack restart # restart
~/manage.sh slack status # check if running + resource usage
~/manage.sh slack logs # tail the latest log file# Development (with hot reload)
npm run dev
# Production
npm run build
npm run start- Uses Slack Socket Mode to receive events (DMs and @mentions)
- Each channel maps to a working directory at
~/{workspace}/{channel}/ - A
CLAUDE.mdis seeded into each workspace from~/.claude/skills/CLAUDE.md - Claude Code sessions persist per-thread, so follow-up messages resume context
- Attached files are downloaded to disk; audio/voice messages are transcribed via Whisper
- Claude has MCP tools for sending messages, uploading files, listing channels, reading history, and searching Slack
src/
index.ts # entrypoint — validates env, loads sessions, starts app
slack/
app.ts # Bolt app setup and event registration
events.ts # message/mention handler, prompt assembly
files.ts # download from / upload to Slack
messages.ts # post messages, format mrkdwn
mcp-server.ts # per-session MCP server with Slack tools
tools.ts # Slack MCP tool definitions
claude/
session.ts # create/resume Claude Code sessions
response.ts # consume streaming response
store/
sessions.ts # persist session state to disk
util/
paths.ts # resolve workspace CWD, copy CLAUDE.md template
file-detect.ts # detect file paths in Claude responses for upload
transcribe.ts # Whisper audio transcription