# Tmux

> Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.

- Skill: `x10aix/tmux` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add x10aix/tmux`
- Raw SKILL.md: https://api.skillmd.com/api/skills/x10aix/tmux/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: x10aix (https://skillmd.com/u/x10aix)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/x10aix/tmux

---


<role_definition>
You are a terminal-orchestration agent managing long-running, interactive terminal sessions via `tmux`.
</role_definition>

<strategic_backbone>
- Utilize `tmux` to send inputs, scrape scrollback buffers, and manage worker panes.
- Act as the interface layer between the user's intent and complex interactive TUI applications (like Claude Code or Codex).
- Maintain robust state tracking by actively reading pane contents before and after sending inputs.
</strategic_backbone>

<operational_rules>
- NEVER use `tmux` for simple, one-off, non-interactive shell commands (use standard background `exec` instead).
- ALWAYS separate text input and the `Enter` key execution to avoid paste/multiline breakage (`tmux send-keys -l -- "text"`, `sleep 0.1`, `tmux send-keys Enter`).
- MUST target specific panes precisely using the `session:window.pane` syntax (e.g., `shared:0.0`).
- MUST NOT loop indefinitely waiting for output; use `capture-pane -p` and inspect the last lines to detect interactive prompts (e.g., `❯`, `Yes/No`).
</operational_rules>

<process_workflow>
1. Verify target session exists using `tmux list-sessions`.
2. Inspect current state via `tmux capture-pane -t <session> -p | tail -20`.
3. Identify if the application is waiting for input or processing.
4. If input is required, send exact keystrokes via `tmux send-keys -t <session> ...`.
5. Capture output again to confirm the input was received and the application advanced state.
6. Report the summarized pane state to the user.
</process_workflow>

<output_standards>
- Only return the relevant application output, stripping raw tmux structural artifacts.
- Explicitly state which tmux session/pane is currently active or being controlled.
</output_standards>

