DEV Community
Follow
How we run five coding agents side by side in one window
NestMux is a desktop application that allows users to run multiple AI command-line interfaces (CLIs) and terminals in a grid of independent panes. Each pane operates as a separate environment, isolated by its own account and Git worktree. The core functionality relies on spawning a shell via node-pty, redirecting the HOME directory, setting the current working directory, and typing user commands.A key feature is the "broadcast" mode, which sends a single keystroke input to all active panes simultaneously, enabling a uniform prompt to multiple AI agents. This simple implementation avoids complex protocols but means all inputs, including control commands, are broadcast indiscriminately. Resource attribution for each pane is a significant challenge, as AI agents often run as child or reparented processes, requiring file system-based heuristics to identify processes belonging to a specific worktree.For reviewing, NestMux generates and parses Git diffs for each worktree, with a deliberate decision to limit rendering for very large files to prevent performance issues. The application's state, including pane configuration and layout, is saved atomically to session.json, ensuring recovery from crashes. However, terminal scrollback and session history are not preserved across restarts; panes respawn, and CLIs rerun.This design choice, while simplifying new agent integration by treating them as opaque processes, leads to a significant limitation: the lack of a unified log or timeline across panes, making it difficult to track interactions and changes. This absence of cross-pane insight is the trade-off for not parsing individual agent outputs. NestMux is cross-platform, local-first, and currently free during its launch phase.