Skip to content
tmux logo

tmux Session Control

tmux

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

TermiX-official/cryptoclaw0installs100stars

SKILL.md

Full skill instructions

tmux Session Control

Control tmux sessions by sending keystrokes and reading output. Essential for managing Claude Code sessions.

When to Use

✅ USE this skill when:

  • Monitoring Claude/​Codex sessions in tmux
  • Sending input to interactive terminal applications
  • Scraping output from long-running processes in tmux
  • Navigating tmux panes/​windows programmatically
  • Checking on background work in existing sessions

When NOT to Use

❌ DON'T use this skill when:

  • Running one-off shell commands → use exec tool directly
  • Starting new background processes → use exec with background:true
  • Non-interactive scripts → use exec tool
  • The process isn't in tmux
  • You need to create a new tmux session → use exec with tmux new-session

Example Sessions

SessionPurpose
sharedPrimary interactive session
worker-2 - worker-8Parallel worker sessions

Common Commands

List Sessions

tmux list-sessions
tmux ls

Capture Output

# Last 20 lines of pane
tmux capture-pane -t shared -p | tail -20

# Entire scrollback
tmux capture-pane -t shared -p -S -

# Specific pane in window
tmux capture-pane -t shared:0.0 -p

Send Keys

# Send text (doesn't press Enter)
tmux send-keys -t shared "hello"

# Send text + Enter
tmux send-keys -t shared "y" Enter

# Send special keys
tmux send-keys -t shared Enter
tmux send-keys -t shared Escape
tmux send-keys -t shared C-c          # Ctrl+C
tmux send-keys -t shared C-d          # Ctrl+D (EOF)
tmux send-keys -t shared C-z          # Ctrl+Z (suspend)

Window/​Pane Navigation

# Select window
tmux select-window -t shared:0

# Select pane
tmux select-pane -t shared:0.1

# List windows
tmux list-windows -t shared

Session Management

# Create new session
tmux new-session -d -s newsession

# Kill session
tmux kill-session -t sessionname

# Rename session
tmux rename-session -t old new

Sending Input Safely

For interactive TUIs (Claude Code, Codex, etc.), split text and Enter into separate sends to avoid paste/​multiline edge cases:

tmux send-keys -t shared -l -- "Please apply the patch in src/​foo.ts"
sleep 0.1
tmux send-keys -t shared Enter

Claude Code Session Patterns

Check if Session Needs Input

# Look for prompts
tmux capture-pane -t worker-3 -p | tail -10 | grep -E "❯|Yes.*No|proceed|permission"

Approve Claude Code Prompt

# Send 'y' and Enter
tmux send-keys -t worker-3 'y' Enter

# Or select numbered option
tmux send-keys -t worker-3 '2' Enter

Check All Sessions Status

for s in shared worker-2 worker-3 worker-4 worker-5 worker-6 worker-7 worker-8; do
  echo "=== $s ==="
  tmux capture-pane -t $s -p 2>/​dev/​null | tail -5
done

Send Task to Session

tmux send-keys -t worker-4 "Fix the bug in auth.js" Enter

Notes

  • Use capture-pane -p to print to stdout (essential for scripting)
  • -S - captures entire scrollback history
  • Target format: session:window.pane (e.g., shared:0.0)
  • Sessions persist across SSH disconnects

More skills from TermiX-official

session-logs logo
TermiX-official/cryptoclaw

session-logs

Search and analyze your own session logs (older/parent conversations) using jq.

100 0
View
obsidian logo
TermiX-official/cryptoclaw

obsidian

Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.

100 0
View
sonoscli logo
TermiX-official/cryptoclaw

sonoscli

Control Sonos speakers (discover/status/play/volume/group).

100 0
View
voice-call logo
TermiX-official/cryptoclaw

voice-call

Start voice calls via the OpenClaw voice-call plugin.

100 0
View
github logo
TermiX-official/cryptoclaw

github

GitHub operations via `gh` CLI: issues, PRs, CI runs, code review, API queries. Use when: (1) checking PR status or CI, (2) creating/commenting on issues, (3) listing/filtering PRs or issues, (4) viewing run logs. NOT for: complex web UI interactions requiring manual browser flows (use browser to...

100 0
View
video-frames logo
TermiX-official/cryptoclaw

video-frames

Extract frames or short clips from videos using ffmpeg.

100 0
View
sag logo
TermiX-official/cryptoclaw

sag

ElevenLabs text-to-speech with mac-style say UX.

100 0
View
notion logo
TermiX-official/cryptoclaw

notion

Notion API for creating and managing pages, databases, and blocks.

100 0
View
skill-creator logo
TermiX-official/cryptoclaw

skill-creator

Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.

100 0
View
whale-watcher logo
TermiX-official/cryptoclaw

whale-watcher

Monitor large transactions and whale movements on-chain.

100 0
View
peekaboo logo
TermiX-official/cryptoclaw

peekaboo

Capture and automate macOS UI with the Peekaboo CLI.

100 0
View
sherpa-onnx-tts logo
TermiX-official/cryptoclaw

sherpa-onnx-tts

Local text-to-speech via sherpa-onnx (offline, no cloud)

100 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View