Discord Blue
Discord Blue is a basic Discord bot plugin system built with the discord.py
library. It includes an agent-session bridge that connects Discord session
threads to local Codex app-server sessions and Claude Code channels.
Chris Busillo (the Director) uses Discord Blue for his own agent sessions and
is its Client.
Run your own Discord Blue
You need Docker, your own Discord bot and server, and Git, Claude Code plus
uv on the computer
running your sessions. No GitHub login or Launchplane is needed. The published
image is Linux AMD64; Apple Silicon needs Docker's AMD64 emulation. The commands
below select that platform explicitly.
-
In the Discord Developer Portal,
create your own application and bot. Enable all three Privileged Gateway
Intents on its Bot page (Presence, Server Members and Message Content).
Install it in your server with the bot and applications.commands scopes.
In two text channels for ordinary and spawned sessions, give it View Channel,
Send Messages, Send Messages in Threads, Create Private Threads, Manage Threads,
Read Message History, Embed Links, Attach Files, Add Reactions, Manage Messages
and Manage Webhooks.
Create an Agent Admin role and assign it to the people who may control
sessions. They also need access to those channels. Enable Discord's Developer
Mode to copy your server, channel and user IDs.
-
In a new directory, create discord-blue.env, make it private with
chmod 600 discord-blue.env, and fill in your own values:
DISCORD_TOKEN=YOUR_BOT_TOKEN
AGENT_SESSION_TOKEN=YOUR_RANDOM_BRIDGE_SECRET
DISCORD_BLUE_GUILD_ID=YOUR_SERVER_ID
DISCORD_BLUE_BOT_CHANNEL_ID=YOUR_MAIN_TEXT_CHANNEL_ID
DISCORD_BLUE_SPAWNED_CHANNEL_ID=YOUR_OTHER_TEXT_CHANNEL_ID
DISCORD_BLUE_AUTO_JOIN_USER_IDS=[YOUR_USER_ID]
Generate the bridge secret with openssl rand -hex 32. The two channel IDs
must differ; use [] for no automatic thread invitations, then invite operators
into private threads manually. For another role
name, add DISCORD_BLUE_OPERATOR_ROLE_NAME=Your Role. Keep this file private
and out of source control. These environment settings enable the session
bridge without interactive setup; they must be supplied on every start.
-
Pull and start the published image:
docker pull --platform linux/amd64 ghcr.io/cbusillo/discord-blue:main
docker run -d --name discord-blue --platform linux/amd64 \
--restart unless-stopped --stop-timeout 120 \
--env-file discord-blue.env \
--volume discord-blue-state:/var/lib/discord-blue \
--publish 127.0.0.1:8787:8787 \
ghcr.io/cbusillo/discord-blue:main
docker logs discord-blue
main follows published main-branch builds; sha-<full commit SHA> pins a
build. There is no latest tag. The named volume keeps configuration and
session recovery state across container replacement; keep it when updating.
Run only one container per bot token and state volume. To update, pull again,
run docker stop discord-blue and docker rm discord-blue, then repeat the
run command. The bridge port is reachable only on the Docker host. From another
computer, use an SSH tunnel such as ssh -N -L 8787:127.0.0.1:8787 user@host;
do not publish the port on all interfaces.
-
On a new session computer, install the local clients. Machines already using
routine bridge delivery keep that installation path
for their launchers and marketplace instead.
uv tool install --python 3.13 git+https://github.com/cbusillo/discord-blue.git
uv tool update-shell
claude plugin marketplace add https://github.com/cbusillo/discord-blue.git
claude plugin install dui@discord-blue
Open a new terminal if needed so discord-blue-claude-channel is on PATH.
Create ~/.config/discord-blue/codex-bridge.token containing only the same
bridge secret, with mode 600, and ~/.config/discord-blue/codex-bridge.toml:
server_url = "ws://127.0.0.1:8787/agent-session/connect"
token_file = "~/.config/discord-blue/codex-bridge.token"
Approve the plugin as a channel once, in Claude Code's managed settings
(this needs an administrator password):
sudo mkdir -p "/Library/Application Support/ClaudeCode/managed-settings.d"
echo '{"channelsEnabled": true, "allowedChannelPlugins": [{"plugin": "dui", "marketplace": "discord-blue"}]}' \
| sudo tee "/Library/Application Support/ClaudeCode/managed-settings.d/discord-blue.json"