Architecture overview
What botmux does fits in one sentence: it turns Lark messages into input for an AI coding CLI, and turns the CLI's output back into Lark cards. This page covers which processes make up botmux, how a message flows through them, and what happens on restart. You don't need any of this for day-to-day use; come back when you're troubleshooting or contributing.
The big picture

What each process does
Key points:
- One daemon per bot, fully isolated. A problem in one bot won't take the others down. See Multi-bot.
- A "session backend" sits between the worker and the CLI. The default is tmux: the CLI lives inside tmux, so restarting the worker or daemon doesn't interrupt it.
- Want to drive a CLI over HTTP without Lark at all? Use the single-process Core-only mode. It skips the supervisor and doesn't need
bots.json.
How a message flows

Take "@ the bot in a topic and say something" as an example:
- Lark pushes the message to the daemon. The daemon first decides whether to handle it: was the bot @-mentioned, is this a topic it owns, does the sender have permission.
- Slash commands are recognized. Messages starting with
/are classified against the command table (e.g./close,/restart) and either handled by the daemon or passed to the CLI. Full list in Slash commands. - The session is found or created. A new topic starts a new worker and CLI; an existing session is reused and the message is typed into the running CLI.
- Output becomes cards. The worker keeps reading the CLI's output, converts it to Markdown, updates the streaming card in Lark in real time, and posts the final reply when the turn ends.
- The CLI can also send messages on its own. botmux injects a set of built-in Skills into the CLI (such as
botmux-send,botmux-schedule,botmux-history), which it uses to post to the topic, create scheduled tasks, read chat history and more. See Skills and CLI commands.
What happens on restart

botmux restart restarts the daemon and workers. Whether the CLI restarts too depends on the session backend:
If tmux isn't available, botmux does not silently fall back to pty. It blocks new sessions and shows a card asking you to install tmux. Details in Persistent tmux sessions and ZMX backend.
On startup the daemon automatically restores previously active sessions, so you can keep chatting in your Lark topics after a restart.
Where files live
Source map (for contributors)
If you want to change the code, start here:
For the full steps to add a new CLI, see src/adapters/cli/CLAUDE.md in the repository.
