Comment

Comment by d4rkp4ttern

I learned about Tmux just a few weeks ago and found out that one of the nifty features is that it is scriptable, I.e allows programmatically sending keystrokes to a specific pane. Then, inspired by some Japanese forums I asked myself if I can leverage this to have Claude Code actually interact with an interactive CLI script — we know CC can launch a script via bash but if said script waits for user input then CC can’t (easily) interact with it. Turns out yes we can leverage Tmux for this!

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

    uv tool install claude-code-tools
https://github.com/pchalasani/claude-code-tools

There 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.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton