Skip to content
Skillpedia
Deploy & cloud (DevOps)394k · #86

tmux

What it does

It guides an AI agent through reading the output of tmux sessions and sending input to them, especially interactive tools that are already running. It is for developers who keep long-running terminal tasks in tmux.

When to use it

  • ✓When you want to see what a running terminal tool is printing.
  • ✓When a tool in a tmux session is waiting for input and needs a reply.
  • ✓When you need to start, rename, or close a tmux session.

Skill link

https://github.com/openclaw/openclaw/blob/main/skills/tmux/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/openclaw/openclaw/blob/main/skills/tmux/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Check the tmux session called worker and tell me what it is printing right now.”

5 new skills a week. 1 minute to read.

How it works

The skill lists the sessions and panes, reads the recent output, and sends text or keys when you ask. It confirms that a prompt is understood before approving or choosing anything.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

tmux

Use for existing interactive tmux sessions. For one-shot commands, use normal shell. For new non-interactive background jobs, use background execution.

Basics

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:

tmux send-keys -t shared:0.0 -l -- "Please continue"
tmux send-keys -t shared:0.0 Enter

Special keys:

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

tmux new-session -d -s worker
tmux rename-session -t old new
tmux kill-session -t worker

Prompt checks

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:

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:

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

Will it send commands without asking?

It approves a prompt only when the prompt is understood and the action is clear.

Is tmux for one-off commands?

No. For one-off commands the normal shell is simpler, and tmux is for existing interactive sessions.

Can it wait for a task to finish?

Yes. A helper script can wait until a pane shows certain text, although a unique marker works best.

Details

Original description by the author

Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts.

repo: openclaw/openclaw

Popularity

GitHub stars
394k
Ranking position
#86
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills