tmux — Claude skill: drive sessions, panes, send-keys
Lets an agent work with live tmux sessions: read pane output, send keys and text, wait for a prompt line to show up.
npx skills add openclaw/openclaw --skill tmux -a claude-codeWhat tmux does
Reach for this skill when an interactive program is already running inside tmux and the agent has to talk to it. It lists sessions, windows and panes, dumps pane contents with tmux capture-pane -p, and sends input with send-keys. Arbitrary text goes through -l --, and Enter is a separate call, which avoids newline surprises.
Two helper scripts ship with it. scripts/find-sessions.sh discovers sessions, scripts/wait-for-text.sh blocks until the captured pane contains a given string. That second script matches echoed input and scrollback too, so the example builds a nonce marker and splits its full text across arguments in the command sent to tmux — the echoed line never carries the complete marker.
You need tmux installed, on macOS or Linux. One-shot commands don't need this skill; plain shell is enough. New non-interactive background jobs belong to background execution instead. Worth installing if you keep long interactive sessions around. If your work finishes in a single command, skip it.
What it helps with
- read output from an interactive program running in tmux
- send literal text plus Enter to a specific pane
- wait for a permission prompt or a proceed line to appear
- list sessions, windows and panes before touching anything
- approve a prompt in another session once you understand it
Example prompts for the agent
- check what's in pane shared:0.0 and tell me if it's waiting for input
- send "Please continue" to worker-3 and press Enter
- wait until shared:0.0 shows a proceed line, then show the last 20 lines
How to install tmux
1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill tmux -a claude-code2Manually: put the files in place
~/.claude/skills/tmux/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tmux/
1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill tmux -a codex2Manually: put the files in place
.agents/skills/tmux/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill tmux -a cursor2Manually: put the files in place
.cursor/skills/tmux/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openclaw/openclaw tmux2Manually: put the files in place
.github/skills/tmux/SKILL.md1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill tmux -a gemini-cli2Platform CLI
gemini skills install https://github.com/openclaw/openclaw --path skills/tmuxManually: put the files in place
.devin/skills/tmux/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill tmux -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set45
The whole set →Similar
Questions about tmux
How do I install the tmux skill in Claude?
Run npx skills add openclaw/openclaw --skill tmux -a claude-code. The skill lands at ~/.claude/skills/tmux/SKILL.md.
What does the tmux skill do?
It controls existing tmux sessions and panes: lists them, captures output, sends keys and text, and monitors prompts for a matching line.
What do I need for it to work?
tmux installed on macOS or Linux. For one-shot commands you don't need the skill at all — use a normal shell.
Source text
SKILL.md · MIT
---
name: tmux
description: "Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts."
metadata:
{
"openclaw":
{
"emoji": "🧵",
"os": ["darwin", "linux"],
"requires": { "bins": ["tmux"] },
"install":
[
{
"id": "brew",
"kind": "brew",
"formula": "tmux",
"bins": ["tmux"],
"label": "Install tmux (brew)",
},
],
},
}
---
# tmux
Use for existing interactive tmux sessions. For one-shot commands, use normal shell. For new non-interactive background jobs, use background execution.
## Basics
```bash
tmux ls
tmux list-windows -t shared
tmux list-panes -t shared:0
tmux capture-pane -t shared:0.0 -p
tmux capture-pane -t shared:0.0 -p -S -
```
Target format: `session:window.pane`, e.g. `shared:0.0`.
## Send input
Literal text, then Enter:
```bash
tmux send-keys -t shared:0.0 -l -- "Please continue"
tmux send-keys -t shared:0.0 Enter
```
Special keys:
```bash
tmux send-keys -t shared:0.0 C-c
tmux send-keys -t shared:0.0 C-d
tmux send-keys -t shared:0.0 Escape
```
Use `-l --` for arbitrary text. Split text and Enter to avoid paste/newline surprises.
## Sessions
```bash
tmux new-session -d -s worker
tmux rename-session -t old new
tmux kill-session -t worker
```
## Prompt checks
```bash
tmux capture-pane -t worker-3 -p | tail -20
tmux capture-pane -t worker-3 -p | rg "proceed|permission|Yes|No|❯"
```
Approve/select only when the prompt is understood:
```bash
tmux send-keys -t worker-3 -l -- "y"
tmux send-keys -t worker-3 Enter
```
## Helpers
- `scripts/find-sessions.sh`: discover sessions.
- `scripts/wait-for-text.sh`: wait until captured pane contents contain text.
`wait-for-text.sh` searches echoed input and scrollback as well as process output. For command completion, use a unique marker whose full text is split across arguments in the command sent to tmux:
```bash
nonce="$(od -An -N8 -tx1 /dev/urandom | tr -d ' \n')"
marker="OPENCLAW_DONE_${nonce}"
tmux send-keys -t shared:0.0 -l -- "sleep 4; printf '%s%s\n' 'OPENCLAW_DONE_' '$nonce'"
tmux send-keys -t shared:0.0 Enter
scripts/wait-for-text.sh -t shared:0.0 -p "$marker" -F -T 30
```
The echoed command never contains the complete marker, and the nonce prevents an older completion line from matching.
## Notes
- `capture-pane -p` prints to stdout for scripts.
- `-S -` captures full scrollback.
- tmux sessions persist across SSH disconnects.
© openclaw · MIT · openclaw/openclaw