Skip to main content

Discord-to-Claude Code session router — Hub component

Project description

Chorus

Route a single Discord bot to multiple Claude Code sessions. Each Discord channel maps to a dedicated Claude Code session with full capabilities — tools, CLAUDE.md, hooks, skills, MCP servers, everything.

                                               ┌─ Relay MCP ←stdio→ Claude Code Session 1
Discord Bot ── Chorus Hub (persistent) ── HTTP ─┤─ Relay MCP ←stdio→ Claude Code Session 2
                                               └─ Relay MCP ←stdio→ Claude Code Session 3

Hub (Python) — persistent process that connects to Discord, routes messages to relays via HTTP. Relay (TypeScript/Bun) — lightweight MCP server spawned by Claude Code, one per session.

Get Started

Prerequisites

  • Python 3.10+
  • Bun runtime
  • A Discord bot with Message Content Intent enabled (create one here)
    • Permissions needed: Send Messages, Read Message History, Add Reactions, Attach Files

Install

# Hub
pip install chorus-hub

# Relay (Claude Code plugin)
claude plugin install chorus-relay

Research preview: Until Chorus is on the official plugin allowlist, install from our marketplace:

claude plugin marketplace add chorus-marketplace --source github --repo zxiang77/chorus-marketplace
claude plugin install chorus-relay@chorus-marketplace

Configure

# Set your Discord bot token
export DISCORD_BOT_TOKEN="your-bot-token"

# Allow your Discord user ID (right-click your name in Discord → Copy User ID)
chorus allow <your-user-id>

Run

# Terminal 1: Start the Hub
chorus hub

# Terminal 2: Connect a channel (right-click channel → Copy Channel ID)
CHORUS_CHANNEL=<channel-id> claude

Research preview: Add --dangerously-load-development-channels server:chorus-relay to the claude command until Chorus is on the official allowlist.

chorus connect <channel-id> prints the exact command for you.

Send a message in the Discord channel. Claude receives it and can reply.

Multiple channels

Each channel gets its own Claude session. Open a new terminal for each one:

# Terminal 2
CHORUS_CHANNEL=1111111111 claude

# Terminal 3
CHORUS_CHANNEL=2222222222 claude

Research preview: Add --dangerously-load-development-channels server:chorus-relay to each claude command until Chorus is on the official allowlist.

Check active sessions: chorus status

Commands

Command Description
chorus hub Start the Hub (Discord bot + HTTP router)
chorus status Show active channel-to-session mappings
chorus connect <channel-id> Print the Claude Code launch command for a channel
chorus allow <user-id> Add a Discord user to the sender allowlist

Channel context

Set a Discord channel's topic/description to give Claude context (e.g., "CCTrade options trading tools. Working directory: cctrade/"). The relay injects this as system prompt context automatically.

Troubleshooting

Symptom Fix
Hub won't start Check DISCORD_BOT_TOKEN is set; enable Message Content Intent in Discord Developer Portal
Messages not arriving Run chorus allow <user-id>; verify chorus status shows the channel
Relay won't register Start the Hub first (it creates ~/.chorus/.secret on first run)
Reply doesn't appear in Discord Check bot has Send Messages permission in the channel

Docs

  • Reference — configuration, environment variables, HTTP API, security
  • E2E Testing — step-by-step manual testing guide
  • Phase History — development phase documentation

Development

# Hub tests
python -m pytest hub/tests/ -v

# Relay tests
cd relay && bun test

# Lint
ruff check hub/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chorus_hub-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chorus_hub-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file chorus_hub-0.1.0.tar.gz.

File metadata

  • Download URL: chorus_hub-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chorus_hub-0.1.0.tar.gz
Algorithm Hash digest
SHA256 059fd55bf898ea7f416087cf265dee2eeecbfd12086e96faafcb5b81eb9523f9
MD5 3210a8d5b6b1790fd5b561ecd9d3b1a3
BLAKE2b-256 4e21a36869e561e007c876c4a4b725a6bd1a8b360ea69552fc3b4d9ac38aaa80

See more details on using hashes here.

Provenance

The following attestation bundles were made for chorus_hub-0.1.0.tar.gz:

Publisher: publish-hub.yml on zxiang77/chorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chorus_hub-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chorus_hub-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chorus_hub-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a281296e5bdad597259b871dae15500a2a9aff5fa945f2edd08dcbfe97e7f381
MD5 bb0375ec70d31da841421dc6a866bf64
BLAKE2b-256 90406495f456a7e4856c65e56596643be103318a19dd76e3ed2c855874215670

See more details on using hashes here.

Provenance

The following attestation bundles were made for chorus_hub-0.1.0-py3-none-any.whl:

Publisher: publish-hub.yml on zxiang77/chorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page