Skip to content

Getting Started

Rina edited this page May 12, 2026 · 1 revision

Getting Started

Prerequisites

  • Node.js 22+
  • pnpm (via corepack)
  • tmux installed on the host
  • Claude Code CLI installed (npm install -g @anthropic-ai/claude-code)
  • A Discord Bot Token with the following intents: Guilds, GuildMessages, MessageContent

Discord Bot Setup

  1. Go to the Discord Developer Portal
  2. Create a new application
  3. Go to BotReset Token → copy the token
  4. Enable Privileged Gateway Intents:
    • MESSAGE CONTENT INTENT
    • SERVER MEMBERS INTENT (optional, for role-based ACL)
  5. Go to OAuth2URL Generator:
    • Scopes: bot, applications.commands
    • Bot Permissions: Send Messages, Manage Channels, Read Message History, Attach Files, Add Reactions
  6. Use the generated URL to invite the bot to your server

Installation

Option 1: Docker (Recommended)

git clone https://github.com/aomkoyo/claude-tmux-discord.git
cd claude-tmux-discord
cp .env.example .env

Edit .env and set at minimum:

DISCORD_TOKEN=your-bot-token-here

Start the bot:

docker compose up -d

Authenticate Claude Code inside the container:

docker compose exec bot claude login

The Claude session is persisted via the ./claude-config:/home/node/.claude volume mount.

Option 2: Local (Bare Metal)

git clone https://github.com/aomkoyo/claude-tmux-discord.git
cd claude-tmux-discord
./setup.sh
cp .env.example .env

Edit .env with your Discord token, then:

pnpm dev     # development with hot-reload
# or
pnpm build && pnpm start   # production

First Run

  1. The bot registers slash commands on startup (guild-scoped if REGISTER_GUILD_ID is set, otherwise global — global can take up to 1 hour)
  2. Use /new name:my-room in any channel to create a Claude room
  3. Type messages in the created #claude-my-room channel
  4. Press /enter to send buffered messages to Claude
  5. Claude responds directly in the channel via discord-send

Build Commands

pnpm build        # prisma generate + tsc + copy generated client to dist/
pnpm start        # prisma migrate deploy + node dist/index.js
pnpm dev          # prisma generate + migrate deploy + tsx watch (auto-reload)
pnpm typecheck    # tsc --noEmit

Clone this wiki locally