Zellij for Coding Agents: A Session-per-Agent Setup

Five keys and a knurled knob sit in the weighty aluminium body of EM Mini Pad, which connects by USB-C or Bluetooth. That compact set is enough for restrained Zellij navigation while normal typing stays on the keyboard.

Why pick Zellij over tmux for agent work?

Zellij exposes modes and available actions in its default interface, which can help a new user discover pane, tab and session controls. Its layouts can describe tabs and panes in one readable KDL file. Those conveniences do not make it universally better than tmux, but they can reduce the amount of configuration needed for a visible multi-agent workspace.

Use one named session for each isolated task or one project session with a tab per task. The working directory and Git branch remain the real boundary; a session name alone does not prevent two agents from editing the same files.

How do you define a layout per agent?

Create a KDL layout that opens the intended working directory and the smallest useful set of panes. One pane can host the agent and another can run tests or show logs. Start Zellij with the layout option, then confirm every command and directory before turning it into a reusable shortcut.

Layouts may also contain configuration and keybindings that take precedence for that launch. Remote layouts can pause commands for approval, so do not assume downloaded definitions execute silently or deserve trust. Keep local layouts under review with the project tooling.

How do you switch sessions with dedicated keys?

Zellij's session manager can create, rename, switch and remove sessions. First learn its normal interface and recovery route. For hardware, have a pad key emit a spare function code, then map that code in Zellij's mode-aware keybinding configuration to a narrow navigation action.

Avoid a physical macro that replays a chain of mode changes. The active mode determines what a key means, and a missed step can send text into the agent. Leave Enter and approval decisions off the pad.

What is worse than tmux here?

Zellij's default status areas and modal controls can feel busy, and its KDL configuration is another syntax to learn. tmux is older, commonly installed on servers and backed by a very large body of operational knowledge. Zellij may be absent on a locked-down remote host.

The EM Mini Pad cannot solve those tradeoffs. Assign only session list, previous tab, next tab and one safe display action, then keep the standard bindings visible until the custom setup survives a restart and an SSH reconnect.

Back to blog