-
Notifications
You must be signed in to change notification settings - Fork 0
Multi Agent
The bot can run different AI coding agents — not just Claude Code. Each room can use a different agent CLI. Agents are defined via environment variables.
Use AGENT_<NAME>=<full command> in your .env file:
AGENT_CLAUDE=claude --dangerously-skip-permissions
AGENT_CODEX=codex --full-auto
AGENT_GEMINI=gemini --yolo
AGENT_COPILOT=copilotThe name after AGENT_ becomes the agent identifier (lowercased). Use it with /new and /agent.
If no AGENT_* variables are set, the bot registers a single agent:
- Name:
claude - Command: value of
CLAUDE_CMDenv var (default:claude)
Each agent can have its own system prompt via AGENT_<NAME>_PROMPT:
AGENT_CLAUDE=claude --dangerously-skip-permissions
AGENT_CLAUDE_PROMPT=You are connected to Discord. Use discord-send to reply...
AGENT_GEMINI=gemini --yolo
AGENT_GEMINI_PROMPT=You are a Gemini agent. Use discord-send to communicate...If AGENT_<NAME>_PROMPT is not set, the agent uses the default CLAUDE_SYSTEM_PROMPT.
When the agent command starts with claude, Claude-specific behavior is applied:
-
--append-system-promptflag injects the system prompt -
--permission-modeor--dangerously-skip-permissionsbased on room mode -
--continueflag for session resume - Claude history in
~/.claude/projects/is checked for resume
For all other agents:
- The system prompt is sent as the first message after the agent boots
- Mode flags are not applied (they're Claude-specific)
- Resume (
--continue) is not applied - The agent still gets
DISCORD_TOKENandDEFAULT_CHANNEL_IDenv vars
/new name:my-room agent:codex
/new name:fix-bug agent:gemini
/new name:review agent:claude
If agent is omitted, the default agent is used (first AGENT_* found, or claude).
/agent gemini
This will:
- Show the new agent name and command
- Reset the tmux session (the current session is killed)
- Next
/enterstarts the new agent
/status
Shows the agent name and its full command.
/help
The help text lists all configured agents and their commands.
The bot uses a universal regex to detect when any agent is ready:
/[❯>$#%]\s*$/
This matches common CLI prompt characters:
-
❯— Claude Code -
>— various CLIs -
$— bash/shell prompts -
#— root prompts -
%— zsh prompts
The bot polls the tmux pane every second for up to 60 seconds.
# .env
DISCORD_TOKEN=your-token
REGISTER_GUILD_ID=your-guild
# Agents
AGENT_CLAUDE=claude --dangerously-skip-permissions
AGENT_CODEX=codex --full-auto
AGENT_GEMINI=gemini --yolo
# Custom prompt for Gemini
AGENT_GEMINI_PROMPT=You are connected to a Discord bot. Use discord-send "<message>" to reply to the user. Anything you output that is NOT this command stays hidden.
# Fallback system prompt (used when AGENT_<NAME>_PROMPT is not set)
CLAUDE_SYSTEM_PROMPT=claude-tmux-discord — Discord bot for per-channel Claude Code sessions via tmux
Setup
Usage
Technical
Help