drive-remote-terminallisted
Install: claude install-skill 88plug/drive-remote-terminal
# Driving a remote terminal as a human would
You cannot operate an interactive TUI with one-shot SSH. `ssh host 'cmd'` runs a command
and exits; piping into a full-screen program (Claude Code's interactive UI, `vim`, `top`,
a curses installer, a REPL) fails because that program needs a real terminal (a PTY),
stays running, redraws the screen, and reads keystrokes. To be the human at the keyboard
you need two things a human has: **a way to type, and eyes to see the screen.** tmux gives
you both remotely.
## The heart of this skill: the type → wait → screenshot → read loop
**This loop is the whole technique. Everything else is setup around it.** You drive a
remote TUI exactly like a human plays a turn-based game: make one move, look at the
screen, decide the next move.
- **Type (input):** `tmux send-keys -t SESSION 'what the human would type' Enter`
— but for a **long line, send the text and `Enter` as two separate calls** (type, brief
`sleep`, then `Enter`); a fast text+Enter burst often lets `Enter` arrive before the
composer has settled, so the text just sits there unsubmitted (see rule 4). For arbitrary
or untrusted text, use `send-keys -l -- "$text"` (then a separate `Enter`): `-l` forces
*literal* characters so a payload that equals a key name (`Enter`, `Up`, `C-c`) is typed
verbatim instead of interpreted, and `--` stops a leading `-` parsing as a flag.
- **Wait:** `sleep N` — let the app process and redraw.
- **Screenshot (observe):** `tmux capture-pane