tmuxplus
v1.4.0
Published
Discord bot that remote-controls Claude Code (or any CLI agent) running inside tmux sessions — per-channel auto session, voice transcription, message catch-up
Downloads
1,953
Readme
tmuxplus
Discord bot that gives each channel its own tmux session running an AI CLI agent (Claude Code, Codex, Gemini, etc.).
You talk in Discord. The agent works in tmux. Replies come back to Discord.
User → Discord → tmuxplus → tmux session → AI agent
↓
User ← Discord ← tmx discord-send ←──────────┘Install
npm i -g tmuxplusRequires: Node.js >= 22, tmux, at least one AI CLI agent (e.g. claude)
Setup
mkdir my-bot && cd my-bot
tmx init # creates .env, CLAUDE.md, AGENTS.md, workspace/Edit .env — set DISCORD_TOKEN at minimum:
DISCORD_TOKEN=your-bot-token-here
REGISTER_GUILD_ID=your-server-idDiscord bot setup
- Go to Discord Developer Portal
- Create Application → Bot
- Enable Privileged Gateway Intents: Presence, Server Members, Message Content
- Copy bot token → paste in
.env - Invite bot to your server with the OAuth2 URL (Bot scope + Administrator permission)
Run
tmx startFor persistent deployment (survives terminal close):
tmux new-session -d -s my-bot && tmux send-keys -t my-bot 'tmx start' EnterUsage
Once the bot is running in your Discord server:
- Type messages in any registered channel — sent to the agent immediately
- The agent replies back in Discord via
tmx discord-send
Re-syncing the system prompt
If the agent "forgets" how to reply (e.g. after tmux attach or session migration):
# Discord slash command
/append-system-prompt # this channel only
/append-system-prompt target:all # all registered rooms at once
# CLI (from master or any terminal)
tmx append-system-prompt -c <channelId>
tmx append-system-prompt --allSee CLAUDE.md (created by tmx init) for full command reference.
CLI
Every Discord slash command has a CLI equivalent — agents in tmux (like master) can manage rooms without going through Discord:
# Bot lifecycle
tmx init # Create .env, CLAUDE.md, AGENTS.md
tmx start # Run the bot
# Messaging
tmx discord-send "msg" [-c ch] [-r id] [-f file] # Send to Discord
tmx send "msg" [-c ch] [-s session] # Send to agent's tmux
# Room management
tmx rooms # List all rooms with status
tmx status [-c ch] [--all] # Show session info
tmx new <name> [--agent codex] [--dir /path] [--category id] # Create room
tmx delete [-c ch] [--keep-tmux] # Unregister room
tmx rename <name> [-c ch] # Rename room
# Session control
tmx clear [-c ch] # Clear agent + re-send prompt
tmx append-system-prompt [-c ch] [--all] # Re-send system prompt
# Projects
tmx project create <name> --dir <path> # Create project
tmx project list # List projects
tmx project info <category-id> # Show details
tmx project edit <id> --dir <path> # Update workspace
tmx project delete <id> [--rooms] # Delete projectAll commands auto-detect the current channel from the tmux session environment (-c is optional when running inside a room's tmux session).
License
MIT
