/tmux:tmuxfrom tmux
Terminal multiplexer management and workflow automation. Use this skill when working with tmux sessions, windows, and panes, managing terminal layouts, renaming windows intelligently based on project context, or automating terminal workflows with tmux commands.
Ships in tmux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Terminal multiplexer management with intelligent window naming and workflow automation.
This skill provides comprehensive tmux management capabilities including:
Use this skill when:
Windows are automatically named based on these heuristics (in order of priority):
When using tmux-dev-window, the standard pane layout is:
tmux-renameIntelligently rename tmux windows based on project context. (Previously called tmux-rename-windows.)
# Rename windows in current session (dry-run)
tmux-rename -n
# Actually rename windows
tmux-rename
# Target specific session
tmux-rename -s session-name
# Force rename even custom names
tmux-rename -f
# Verbose output
tmux-rename -v
Behavior:
tmux-dev-windowCreate a development window with standard three-pane layout.
# Create dev window in current session
tmux-dev-window
# Create in specific session
tmux-dev-window -s session-name
See docs/tmux-dev-window.md for detailed documentation.
tmux-session (alias: t)Unified session management -- create, switch, link, and list sessions.
# Create/switch to session (detects git repo name)
t # from a git repo directory
t myproject # by name
t ~/Code/repo # by path
# Linked session (independent window views)
t --link # creates projectname-2 linked to current
t --link myproject # link to specific session
# List sessions with client counts
t --list
# Development layout
t --dev # create dev window in current session
# First-only attach (for terminal startup)
t --first-only # attach to "main" only if no clients attached
tmux-theme-detect and tmux-theme-applyDetect system appearance and apply matching tmux theme.
# Detect and apply theme automatically
tmux-theme-detect
# Apply specific theme
tmux-theme-apply light # or dark
See docs/theme-switching.md for details.
tmux-cheatDisplay context-aware cheat sheets based on current pane's program.
# Show cheat sheet for current context
tmux-cheat
# In tmux, press ? to trigger this command
Sessions:
tmux ls # List sessions
tmux new -s name # Create named session
tmux attach -t name # Attach to session
tmux rename-session -t old new # Rename session
Windows:
tmux list-windows # List windows
tmux new-window -n name # Create named window
tmux rename-window name # Rename current window
tmux select-window -t :0 # Switch to window 0
Panes:
tmux list-panes # List panes
tmux split-window -h # Split horizontally
tmux split-window -v # Split vertically
tmux select-pane -t :.0 # Select pane 0
When using tmux commands with -F flag:
#{session_name} - Session name#{window_index} - Window index#{window_name} - Window name#{pane_id} - Unique pane identifier#{pane_current_path} - Current directory#{pane_current_command} - Running commandExample:
tmux list-panes -a -F '#{session_name}:#{window_index} #{window_name} #{pane_current_path}'
ALWAYS read ~/.tmux.conf before using tmux commands to understand:
Critical Rule: Always execute commands in dedicated command panes, never in panes running interactive programs.
Why: The tmux MCP server sends keystrokes. Commands sent to:
Standard Pane Identification:
tmux list-panes -F '#{pane_id} #{pane_current_command}'After executing any tmux command via MCP:
See docs/tmux-mcp.md for comprehensive MCP integration documentation.
Progressive disclosure documentation in docs/:
session-window-pane-management.md - Comprehensive tmux command referencetmux-mcp.md - MCP server setup and AI integration guidetmux-mcp-ai.md - Best practices for AI agents using tmux MCPclaude-code-interaction.md - Sending input to Claude Code sessions (paste handler, bracketed-paste race)teammate-pane-layout.md - Cascading leader + teammate pane pattern for multi-agent workflows (inspired by Claude Code)tmux-dev-window.md - Development window layout documentationtheme-switching.md - Appearance-based theme switchingcheat.md - Quick reference for tmux key bindingsclipboard.md - Clipboard integrationThis tmux package follows metool conventions:
bin/ - Executable scripts (symlinked to ~/.metool/bin/)shell/ - Shell functions, aliases, completions (sourced by metool)config/ - Configuration files (symlinked to home directory)docs/ - Documentation for progressive disclosureSee ~/Code/github.com/mbailey/metool/docs/conventions/package-structure.md for details.
# Install tmux package
mt install tmux
# This will:
# - Symlink bin/ scripts to ~/.metool/bin/
# - Source shell/ functions and aliases
# - Link config/ files to home directory
# Check what would be renamed (dry-run)
tmux-rename -n
# Apply the renames
tmux-rename
# Rename specific session
tmux-rename -s work
# Create new session with dev window
tmux new -s project
tmux-dev-window
# Or attach to existing session
tmux attach -t project
tmux-dev-window
# Auto-connect to session (creates if needed)
t work
# List all sessions
tmux ls
# Switch to specific session
t project
To view different windows of the same session from two terminals, use linked sessions:
# From the second terminal, in the project directory:
t --link
# This creates a grouped session (e.g., taskmaster-2) linked to taskmaster.
# Both terminals share the same windows but can independently select
# which window is active. Ctrl+B N/P in each terminal navigates independently.
# To switch between the original and linked session:
t taskmaster # switch to original
t taskmaster-2 # switch to linked copy
Linked sessions auto-number: if taskmaster-2 exists, it creates taskmaster-3, etc.
The base session must already exist -- create it first with t if needed.
~/.tmux.conf first - Understand user configurationWhen sending input to another Claude Code session via tmux, text and Enter must be sent as separate commands:
# WRONG - text and Enter in same call doesn't reliably submit
tmux send-keys -t pane "message" Enter
# RIGHT - send text with -l (literal) flag, then Enter separately
tmux send-keys -t pane -l "message"
tmux send-keys -t pane Enter
This is how agents minion send works internally. The -l flag ensures the message text is sent literally without interpretation. Always verify the message was received by checking the pane content after sending.
Prefer using agents minion send when available, as it handles this correctly:
agents minion send m-worker "your message here"
For large pastes, bracketed-paste behaviour, and the race condition that
can swallow the submit, see docs/claude-code-interaction.md.
$TMUX_PANE)Inside tmux, $TMUX_PANE holds the pane ID of the shell or program that
inherited the environment -- the pane you are in. #P and
display-message without a target return the active pane of the
current window, which may not be you.
echo "$TMUX_PANE" # e.g. %42 -- your own pane
tmux capture-pane -p -t "$TMUX_PANE" # self-aware capture
See docs/session-window-pane-management.md for sibling-pane patterns.
tmux-rename periodically - Keep window names synchronized with projectsCheck:
tmux show-window-options automatic-rename)tmux-rename -n -vSolutions:
tmux list-panes -F '#{pane_id} #{pane_current_command}'Check:
tmux show-options -g base-indextmux show-options -g pane-base-index~/Code/github.com/mbailey/metool/docs/ai/links.md (opens in a new tab)docs/ai/tmux-clipboard.md (opens in a new tab)docs/appearance.md (opens in a new tab)docs/cheat.md (opens in a new tab)docs/claude-code-interaction.md (opens in a new tab)docs/clipboard.md (opens in a new tab)docs/kill.md (opens in a new tab)docs/session-window-pane-management.md (opens in a new tab)docs/specs/tmux-dev-window.md (opens in a new tab)docs/teammate-pane-layout.md (opens in a new tab)docs/theme-switching.md (opens in a new tab)docs/tmux-dev-window.md (opens in a new tab)docs/tmux-mcp-ai.md (opens in a new tab)docs/tmux-mcp-limitations.md (opens in a new tab)docs/tmux-mcp.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mbailey/tmux --plugin tmux