Very cool ideas in this thread.
I mean, a tty is just a file descriptor... there have been script(1), expect(1) and chat(8) since the 80ies. tmux is not really necessary.
I used it in a previous job to automate configuring thousands of network devices
Bringing another terminal multiplexer isn't an alternative. In my agent, I use pseudo-tty without any tmuxes/screens.
also I'm mostly using it to prepare an interactive environment anyway, so I don't see alternatives for my usecase (maybe zellij, but they don't even support sending keystrokes to a specific pane)
I tell Claude to use the existing tmux CLI to send-keys, capture-pane, etc. and it works flawlessly. Literally just "never use the Bash tool, run all commands in tmux sessions" and it knows what to do from there.
In case anyone was curious, screen can do this too with the command "stuff" (read it as the verb like "stuffing something into a box").
Could I have kitty send each line it receives to an external tool, say via HTTP?
I want to make a custom frontend to claude code, or any other CLI tool, and an obvious easy frontend is a web tool that communicates over HTTP, so getting claude wrapped in a HTTP control system seems like a good starting point.
I'm interested in whether things like "tmux capture-pane" which strips characters come from Kitty as well? Do I need to be cautious of control characters?
So I used Claude Code to build a little el tool called Tmux-cli, which gives a convenient way to have CC (or any CLI coding agent for that matter) spawn a Tmux Pane, launch a script there, and actually interact with it.
So it’s like Playwright/Puppeteer for the terminal.
You can get it via
https://github.com/pchalasani/claude-code-toolsThere are some interesting possibilities this enables:
Let CC autonomously test interactive CLI scripts, without me having to intervene and point out errors.
Have the CLI coding agent launch UI from another pane and then use Puppeteer MCP to test from a browser.
Let CC launch a cli script with a debugger enabled (e.g. Pdb) and set breakpoints etc — for token-efficient code understanding, debugging and explaining.
Let the CLI coding agent spawn and drive another instance of the same or other CLI coding agent, AND interact with it. Note this is way better than CC sub-agents which are “spawn and let go” black-boxes.
I wonder if the discussed Tmux alternatives enable building this type of tool.