I build NestMux, a desktop app that runs Claude Code, Codex, Gemini CLI, Copilot and OpenCode in a grid of real terminals, each with its own account and its own git worktree. This is how it works inside, including the parts that are heuristics wearing a confident UI and the parts that do not survive a restart.
If you are building something similar, most of this transfers. If you are deciding whether to use it, this is the honest version of what it does.
Thirty-five seconds of it running, so the rest of this has something to attach to:
The unit is a pane, and a pane is smaller than you would think
Every cell in the grid is described by a plain object. Simplified, and this really is most of it:






