agentleFS
claude-worldclaude-world/claude-agent/.claude/skills/tmux-control/SKILL.md

tmux-control

Skill5 starsChanged 8 months agoMITView on GitHub

Remote-control tmux sessions — create, attach, list, send keystrokes, and scrape pane output. Use when user says "create tmux session", "send keys to tmux", "read tmux output", "split pane", or "run command in tmux".

  • Deletes or force-pushes
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Always check if tmux is installed first: which tmux

    line 130
  2. Distinctive:

    If not installed, show the install command and stop

    line 131
  3. Very specific:

    Before sending keys, verify the session exists with tmux has-session -t <name>

    line 132
  4. Very specific:

    When capturing output, always save to workspace/tmux-<session>-<timestamp>.txt for long output

    line 133
  5. Very specific:

    Add appropriate sleep between send-keys and capture-pane to allow commands to complete

    line 134
  6. Very specific:

    Never send destructive commands (rm -rf, DROP TABLE, etc.) without explicit user confirmation

    line 135
  7. Very specific:

    Use -d (detached) when creating sessions programmatically — never attach interactively

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tmux Control

Remote-control tmux sessions programmatically. tmux is usually pre-installed; if not, install it with your package manager.

Prerequisites

# macOS
brew install tmux

# Ubuntu/Debian
sudo apt install tmux

# Check version
tmux -V

Commands

Session Management

CommandDescription
tmux list-sessionsList all active sessions
tmux new-session -d -s <name>Create a new detached session
tmux attach-session -t <name>Attach to a session (interactive)
tmux kill-session -t <name>Kill a session
tmux has-session -t <name> 2>/dev/nullCheck if session exists (exit 0 = yes)

Sending Commands & Keystrokes

# Run a command in a session (sends text + Enter)
tmux send-keys -t <session> "ls -la" Enter

# Send to specific window and pane (session:window.pane)
tmux send-keys -t myapp:0.1 "npm run dev" Enter

# Send a raw keystroke (e.g. Ctrl+C)
tmux send-keys -t <session> C-c

# Send without pressing Enter (useful for partial input)
tmux send-keys -t <session> "some text"

Capturing Pane Output

# Capture current visible pane content
tmux capture-pane -t <session> -p

# Capture full scrollback buffer to file
tmux capture-pane -t <session> -p -S - > workspace/tmux-output.txt

# Capture last 100 lines
tmux capture-pane -t <session> -p -S -100

Window & Pane Management

# Create a new window in a session
tmux new-window -t <session> -n <window-name>

# Split pane horizontally (left/right)
tmux split-window -h -t <session>

# Split pane vertically (top/bottom)
tmux split-window -v -t <session>

# List windows in a session
tmux list-windows -t <session>

# List panes in a session
tmux list-panes -t <session>

Usage Examples

Create a session and run a dev server:

tmux new-session -d -s devserver
tmux send-keys -t devserver "cd ~/project && pnpm dev" Enter

Capture output from a running process:

tmux capture-pane -t devserver -p -S -50

Send Ctrl+C then restart:

tmux send-keys -t devserver C-c
sleep 1
tmux send-keys -t devserver "pnpm dev" Enter

Run a command and capture result:

tmux new-session -d -s scratch
tmux send-keys -t scratch "git status" Enter
sleep 1
tmux capture-pane -t scratch -p
tmux kill-session -t scratch

Rules

  • Always check if tmux is installed first: which tmux
  • If not installed, show the install command and stop
  • Before sending keys, verify the session exists with tmux has-session -t <name>
  • When capturing output, always save to workspace/tmux-<session>-<timestamp>.txt for long output
  • Add appropriate sleep between send-keys and capture-pane to allow commands to complete
  • Never send destructive commands (rm -rf, DROP TABLE, etc.) without explicit user confirmation
  • Use -d (detached) when creating sessions programmatically — never attach interactively
  • Confirm actions with a single line: "Sent '<command>' to session <name>"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.