Tmux
Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts.
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Tmux when an AI agent needs a reusable SKILL.md workflow for this job: Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts.
When not to use it
Skip Tmux when the task is outside the writing category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/tmux # Save SKILL.md to ~/.claude/skills/tmux/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/tmux/SKILL.md. For a shared project, commit the folder at .claude/skills/tmux/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Tmux skill for this task: Use Tmux when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
68/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 71/100
- Practical detail
- 68/100
- Source evidence
- 63/100
- Source signals
- 70/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# 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.
Intended uses
- Use Tmux when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.