Skip to content

Claude Discord Bot

This project packages Claude Code into a Docker image that runs on a remote server and receives its instructions from Discord. @mention the bot in an allowed channel and it opens a thread with its own Claude Code session; every thread is a separate context, and threads run in parallel. Claude replies in the thread and can work on code in its /workspace directory: edit files, run tools, commit and push to GitHub.

There are two modes, chosen with BOT_MODE:

  • bridge (default): the thread-session bridge, one session per Discord thread.
  • plugin: the original setup, one shared session through the official discord@claude-plugins-official channel plugin.
Discord ──► bridge (Node, discord.js) BOT_MODE=bridge
│ thread A ──► Claude Code session A ┐
│ thread B ──► Claude Code session B ├─ parallel (Claude Agent SDK)
│ thread C ──► Claude Code session C ┘
▼
/workspace code the bot works on (volume)
/home/node/.claude config, sessions, thread→session map (volume)
git / gh push to GitHub with GH_TOKEN
Piece What it does
bridge/ The thread-session bridge (TypeScript).
Dockerfile Builds the image: Node 22, Bun, Claude Code, the bridge, gh, and common CLI tools.
entrypoint.sh Seeds config, then starts the bridge, or (plugin mode) installs the plugin and starts Claude.
docker-compose.yml Local / plain Docker deployment that builds the image.
docker-compose.portainer.yml Portainer stack that uses a pre-built image.
.env.example Every environment variable the container reads.