Skip to main content
skill CX Codex

tmux-terminal — Claude Code skill for terminal control

This skill uses tmux to send keystrokes, read terminal output, and keep CLI processes running between steps. Use it with interactive TUIs or long-running commands.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mikeyobrien/ralph-orchestrator --skill tmux-terminal -a claude-code
Open on GitHub

What tmux-terminal does

The skill lets an agent operate terminal sessions through tmux. It can start a detached session, run a command, send keys such as Enter or C-c, and capture what appears on screen. That covers tasks like navigating an interactive CLI or checking whether a server has printed a ready message.

Sessions can keep servers, loops, or watch processes alive while the agent moves through other steps. When the task is done, it can stop the process and close the session. tmux must be installed first; the skill's terminal commands depend on it. If a capture comes back empty, the instructions suggest waiting briefly and taking another one.

What it helps with

  • navigate an interactive TUI menu
  • answer prompts in an interactive CLI
  • capture output from a running terminal process
  • keep a server or loop running between steps
  • stop a process and close its tmux session

Example prompts for the agent

  • Start ralph-tui in a separate tmux session and show me the screen output.
  • Run the web server in tmux, check whether it reports readiness, then stop it.
  • Move down through the TUI menu, press Enter, and capture the screen.

How to install tmux-terminal

1Skills CLI (Vercel)

npx skills add mikeyobrien/ralph-orchestrator --skill tmux-terminal -a claude-code

2Manually: put the files in place

~/.claude/skills/tmux-terminal/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/tmux-terminal/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about tmux-terminal

How do I install tmux-terminal in Claude Code?

Run npx skills add mikeyobrien/ralph-orchestrator --skill tmux-terminal -a claude-code. The skill file is at ~/.claude/skills/tmux-terminal/SKILL.md.

What does tmux-terminal do?

It lets an agent control interactive terminal programs and long-running CLI processes with tmux, including sending keys, reading screen output, and ending sessions.

What does tmux-terminal require?

tmux must be installed. Check it with tmux -V.

Source text

SKILL.md · MIT
---
name: tmux-terminal
description: Interactive terminal control via tmux for TUI apps, prompts, and long-running CLI workflows.
hats: [developer, qa_tester]
metadata:
  internal: true
---

# tmux-terminal

## Overview

Use tmux to drive interactive terminal sessions, including TUI workflows like `ralph-tui`. tmux lets you send keystrokes, capture screen output, and keep processes running between steps.

## When to Use

- Testing `ralph-tui` or any interactive CLI prompts
- Managing long-running processes (web server, loops, watch mode)
- Capturing live terminal output for QA reports
- Interacting with applications that redraw the screen

## Prerequisites

- `tmux` installed (pre-installed on macOS)

Verify:
```bash
tmux -V
```

## Core Commands

Create a detached session:
```bash
tmux new-session -d -s <name>
```

Send commands (append Enter to execute):
```bash
tmux send-keys -t <name> "<command>" Enter
```

Capture screen output:
```bash
tmux capture-pane -t <name> -p
```

Kill session when done:
```bash
tmux kill-session -t <name>
```

## Special Keys

Use `send-keys` with key names:
- `Enter`
- `C-c` (Ctrl-C)
- `C-d` (Ctrl-D)
- `Tab`
- `Escape`
- `Up`, `Down`, `Left`, `Right`

Examples:
```bash
tmux send-keys -t <name> Up
tmux send-keys -t <name> C-c
```

## TUI Interaction Patterns

### Start ralph-tui
```bash
tmux new-session -d -s ralph-tui
tmux send-keys -t ralph-tui "cargo run -p ralph-tui" Enter
```

### Navigate in TUI
```bash
tmux send-keys -t ralph-tui Down
tmux send-keys -t ralph-tui Enter
```

### Capture and parse the screen
```bash
tmux capture-pane -t ralph-tui -p -S -200
```

Use `-S -200` to capture the last 200 lines when the screen is noisy.

## Long-Running Process Management

- Start servers or loops in a tmux session to keep them alive.
- Use `capture-pane` to confirm health (look for "listening" or "ready" text).
- Stop cleanly with `C-c` then `kill-session`.

Example:
```bash
tmux new-session -d -s ralph-web
tmux send-keys -t ralph-web "cargo run -p ralph-cli -- web" Enter
tmux capture-pane -t ralph-web -p | rg -n "listening|ready"
tmux send-keys -t ralph-web C-c
tmux kill-session -t ralph-web
```

## Notes

- Keep session names short and unique.
- Always clean up sessions to avoid leaking background processes.
- If output looks empty, wait briefly and capture again.

© mikeyobrien · MIT · mikeyobrien/ralph-orchestrator

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set10

tui-validate This skill screenshots a terminal UI with freeze and judges it against criteria using an LLM. Useful after TUI changes, when you need to catch broken layout. CX Codex +1 ★ 3,189repo stars test-driven-development This skill walks the agent through RED → GREEN → REFACTOR and makes it write tests before code. Useful when a spec or task needs to become checkable tests. CX Codex +1 ★ 3,189repo stars release-bump Walks ralph-orchestrator through a release: raise the version, build, test, tag. Meant for the moment fixes are committed and publishing is next. CX Codex +1 ★ 3,189repo stars pr-demo Records a terminal session with asciinema and turns it into a GIF or SVG you can drop into a pull request. CX Codex +1 ★ 3,189repo stars pdd pdd turns a rough idea into requirements, research, a design document, and an implementation plan. It is for projects that need decisions recorded before coding. CX Codex +1 ★ 3,189repo stars find-code-tasks The skill lists every .code-task.md file in your repository with status and dates. Handy when you want to see what work is still open. CX Codex +1 ★ 3,189repo stars code-assist A skill that walks the agent through Explore, Plan, Code, Commit: research and a plan first, then failing tests, then code. Useful when a task should go through TDD instead of straight to implementation. CX Codex +1 ★ 3,189repo stars ralph-hats Build and inspect Ralph hat collections, check event routing, and tune multi-hat workflows. Useful when creating or debugging a .ralph/hats/*.yml file. CX Codex +1 ★ 3,189repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor