Several Claudes in one window, and a laptop that missed a week
Until today, my workbench layout could only run one Claude at a time. The agent window sits at the right of the layout, with a threads pane under it listing the project’s sessions, and starting a new session (or resuming an old one) while Claude was running there asked whether to quit the running one first. That was fine when I worked on one thing at a time, which I increasingly don’t. So the first request this go around was to keep the running session alive in the background, put the new one in the window, and let me switch between them, with a key to close one as well.
The way it ended up working is pretty simple, once we’d found it. Every window in the layout is a zmx session (zmx is the small persistence tool that replaced tmux for me last week), so now every Claude gets a zmx session of its own: the first in the usual agent session, the rest in agent- plus eight hex digits, each labelled with Claude’s session ID. The agent window no longer just attaches one session; it loops, attaching whichever session is marked as “on show”, and switching is just a matter of changing that mark and detaching the window from the old session, at which point the loop attaches the new one. Nothing has to talk to kitty, which matters because on desktom the agent runs as its own user and can only touch its own windows. In the threads pane, ▶ marks the session on show and ▷ the ones in the background; Enter on a running one shows it, Tab goes to the next, and x closes one (the transcript stays, so it can be resumed later). New sessions also get their ID assigned up front with --session-id, so the pane knows which thread is which from the start.
Starting those background sessions had one wrinkle. zmx run makes a session without attaching to it, but it does so by typing the command into a fresh shell, followed by an echo of a completion marker, both of which then sit at the top of the screen. The fix was to type exec sh -c '…' instead: the shell is replaced, the marker never runs, the first thing the inner shell does is clear the screen, and the session ends when Claude does. A bit of a trick, but it works.
The second issue was the Markdown view. In the layout, Space m v covers Neovim with a rendered view of the file (big headings, real images), and q gives Neovim back. But if I opened another file from the file explorer while the view was up, the file appeared in Neovim, and the view never came back until I restarted the editor. It turns out that when you focus a kitty window that has an overlay on top of it, the window comes to the front and the overlay keeps running behind it. So Neovim was still waiting on a view I couldn’t see, and politely refused to open a second one. Now opening a file closes any view over the editor first, and Space m v replaces an earlier view instead of refusing. While we were in there, Markdown now opens rendered by default (except for Claude’s Ctrl-G prompt, which happens to be a Markdown file and would be rather annoying rendered), and the view shows Neovim’s other open Markdown files as tabs along the top, switched with Tab or 1-9.
Testing all this happens in a headless kitty on a headless compositor, so nothing touches my actual desktop. The first round of tests confidently ran the old threads pane. The windows type bench threads into a login shell, my zsh config puts ~/.local/bin first on the PATH, and that bench points at the live checkout rather than the branch being tested. The harness got a minimal zsh config of its own after that.
Then laptom. I’ll be travelling from Wednesday with desktom off, and laptom turned out to be stuck where I left it on the 20th: still on the tmux-era workbench, Ghostty as the terminal, no kitty config at all, zmx and a couple of other packages missing, and (as I found out) a plain “Hyprland” session rather than the uwsm one, which is why the ssh-agent fix from yesterday wouldn’t have helped there anyway. The agent’s account on laptom had no workbench whatsoever. Nothing reminds you to update a machine you aren’t using, as we know.
Most of the catch-up is mine to run, since it’s my account: move my clone to ~/.local/share/workbench like on desktom, reinstall, set up the agent, log in with the uwsm session, and check ssh-add -l in a new kitty window. The agent did its own side, and installed the packages I okayed. One thing it caught before I ran anything: bench setup agent, run as me, gives the agent user a workbench of its own, and since the agent can’t read my home directory, that would have been a private copy, silently replacing its link to the shared checkout it actually works in. Workbench now keeps an agent’s existing git checkout instead. It also checked, with sshd -T on a scratch config, that the Match block workbench writes into laptom’s sshd config ends at the end of its file rather than swallowing Arch’s settings after it. Breaking sshd on a LUKS laptop is not something I want to discover from a hotel.
I also asked for desktom’s wallpaper setup (Waypaper with awww, mpvpaper and linux-wallpaperengine) on laptom. The little cleanup script that stops the backends Waypaper forgets about lived in desktom’s repo, which laptom doesn’t have, so it moved into workbench, and workbench now restores the wallpaper at login whenever Waypaper is installed. linux-wallpaperengine compiles for a while, as it turns out.
Last, remote layouts: bench open host:/path gives me the same layout with every window on a server. All thirteen fleet servers got the packages it needs and lingering for my account, my desktom key went onto the four that only took a password, and the agent opened a layout on each of them from both desktom and laptom, as its own user, in the headless kitty. Thirteen for thirteen, twice. My own accounts on the servers still need bench install --host from me, and laptom will need a key of its own.
The one casualty of the day was a cleanup command. Shutting down the test compositor with pkill -f and its full command line also matched the shell running the cleanup, since that shell’s command line contained the same text. Everything after it had in fact run, which took a minute to establish. Lesson noted: pgrep -x for the process name, not -f for a pattern you’ve just typed.