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-relayto theclaudecommand 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-relayto eachclaudecommand 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
059fd55bf898ea7f416087cf265dee2eeecbfd12086e96faafcb5b81eb9523f9
|
|
| MD5 |
3210a8d5b6b1790fd5b561ecd9d3b1a3
|
|
| BLAKE2b-256 |
4e21a36869e561e007c876c4a4b725a6bd1a8b360ea69552fc3b4d9ac38aaa80
|
Provenance
The following attestation bundles were made for chorus_hub-0.1.0.tar.gz:
Publisher:
publish-hub.yml on zxiang77/chorus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chorus_hub-0.1.0.tar.gz -
Subject digest:
059fd55bf898ea7f416087cf265dee2eeecbfd12086e96faafcb5b81eb9523f9 - Sigstore transparency entry: 1325088968
- Sigstore integration time:
-
Permalink:
zxiang77/chorus@d4988d2cda04f51f941d711f869b8d9f12e6a7b1 -
Branch / Tag:
refs/tags/hub-v0.1.0 - Owner: https://github.com/zxiang77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-hub.yml@d4988d2cda04f51f941d711f869b8d9f12e6a7b1 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a281296e5bdad597259b871dae15500a2a9aff5fa945f2edd08dcbfe97e7f381
|
|
| MD5 |
bb0375ec70d31da841421dc6a866bf64
|
|
| BLAKE2b-256 |
90406495f456a7e4856c65e56596643be103318a19dd76e3ed2c855874215670
|
Provenance
The following attestation bundles were made for chorus_hub-0.1.0-py3-none-any.whl:
Publisher:
publish-hub.yml on zxiang77/chorus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chorus_hub-0.1.0-py3-none-any.whl -
Subject digest:
a281296e5bdad597259b871dae15500a2a9aff5fa945f2edd08dcbfe97e7f381 - Sigstore transparency entry: 1325089133
- Sigstore integration time:
-
Permalink:
zxiang77/chorus@d4988d2cda04f51f941d711f869b8d9f12e6a7b1 -
Branch / Tag:
refs/tags/hub-v0.1.0 - Owner: https://github.com/zxiang77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-hub.yml@d4988d2cda04f51f941d711f869b8d9f12e6a7b1 -
Trigger Event:
push
-
Statement type: