tmux

Complete tmux terminal multiplexer management: sessions, windows, panes, layouts, scripting, and configuration. Auto-activates on: "tmux", "session", "window", "pane", "split", "attach", "detach", "multiplexer".

14 stars

Best use case

tmux is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Complete tmux terminal multiplexer management: sessions, windows, panes, layouts, scripting, and configuration. Auto-activates on: "tmux", "session", "window", "pane", "split", "attach", "detach", "multiplexer".

Teams using tmux should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tmux/SKILL.md --create-dirs "https://raw.githubusercontent.com/bntvllnt/agent-skills/main/tmux/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tmux/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tmux Compares

Feature / AgenttmuxStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Complete tmux terminal multiplexer management: sessions, windows, panes, layouts, scripting, and configuration. Auto-activates on: "tmux", "session", "window", "pane", "split", "attach", "detach", "multiplexer".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# tmux

Complete tmux management for terminal multiplexing.

## Core Concepts

```
┌─────────────────────────────────────────────────────────────┐
│ SERVER (one per socket)                                     │
│  ┌───────────────────────────────────────────────────────┐  │
│  │ SESSION ($0, $1, ...)                                 │  │
│  │  ┌─────────────────┐  ┌─────────────────┐            │  │
│  │  │ WINDOW (@0)     │  │ WINDOW (@1)     │  ...       │  │
│  │  │  ┌────┬────┐   │  │  ┌────────────┐ │            │  │
│  │  │  │PANE│PANE│   │  │  │   PANE     │ │            │  │
│  │  │  │ %0 │ %1 │   │  │  │    %2      │ │            │  │
│  │  │  └────┴────┘   │  │  └────────────┘ │            │  │
│  │  └─────────────────┘  └─────────────────┘            │  │
│  └───────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘
```

- **Server**: Background process managing all state
- **Session** (`$id`): Named container of windows, persists after detach
- **Window** (`@id`): Tab-like container of panes within a session
- **Pane** (`%id`): Individual terminal within a window
- **Client**: Terminal attached to a session

## Router

| User says | Load reference | Do |
|---|---|---|
| list sessions / status | `references/session-management.md` | inspect sessions |
| new session / create session | `references/session-management.md` | create session |
| attach / detach | `references/session-management.md` | attach/detach |
| kill session | `references/session-management.md` | terminate session |
| new window / create window | `references/window-management.md` | create window |
| rename window | `references/window-management.md` | rename window |
| kill window / close window | `references/window-management.md` | close window |
| switch window | `references/window-management.md` | navigate windows |
| split / new pane | `references/pane-management.md` | split pane |
| resize pane | `references/pane-management.md` | resize pane |
| move pane / swap pane | `references/pane-management.md` | rearrange panes |
| kill pane / close pane | `references/pane-management.md` | close pane |
| layout | `references/layouts.md` | apply/manage layouts |
| copy / paste / buffer | `references/copy-mode.md` | copy mode operations |
| config / tmux.conf / settings | `references/configuration.md` | configure tmux |
| keybind / bind / unbind | `references/keybindings.md` | key bindings |
| script / automate / send-keys | `references/scripting.md` | scripting/automation |
| capture / log / output | `references/scripting.md` | capture pane content |
| help / keys / cheatsheet | inline | show key reference |

## Default Key Bindings (Prefix: `C-b`)

### Session

| Key | Action |
|-----|--------|
| `d` | Detach from session |
| `s` | List/switch sessions |
| `$` | Rename session |
| `(` / `)` | Previous/next session |

### Window

| Key | Action |
|-----|--------|
| `c` | Create window |
| `&` | Kill window (confirm) |
| `,` | Rename window |
| `0-9` | Switch to window N |
| `n` / `p` | Next/previous window |
| `l` | Last window |
| `w` | List windows |
| `f` | Find window |

### Pane

| Key | Action |
|-----|--------|
| `%` | Split horizontally (left/right) |
| `"` | Split vertically (top/bottom) |
| `x` | Kill pane (confirm) |
| `o` | Cycle panes |
| `q` | Show pane numbers |
| `z` | Toggle zoom |
| `{` / `}` | Swap pane left/right |
| `!` | Break pane to window |
| Arrows | Navigate panes |
| `Space` | Cycle layouts |
| `C-o` | Rotate panes |

### Copy Mode

| Key | Action |
|-----|--------|
| `[` | Enter copy mode |
| `]` | Paste buffer |
| `=` | Choose paste buffer |
| `#` | List buffers |

## Quick Reference

```bash
# Session
tmux new -s name              # Create named session
tmux attach -t name           # Attach to session
tmux ls                       # List sessions
tmux kill-session -t name     # Kill session

# Window
tmux new-window -n name       # Create named window
tmux select-window -t :N      # Go to window N
tmux rename-window name       # Rename current window

# Pane
tmux split-window -h          # Split horizontal
tmux split-window -v          # Split vertical
tmux select-pane -t :.N       # Go to pane N
tmux resize-pane -D 5         # Resize down 5 lines

# Info
tmux list-keys                # All key bindings
tmux info                     # Server info
```

## Safety Rules

- **Confirm before kill**: Always confirm before `kill-session`, `kill-window`, `kill-pane`
- **Check attachments**: Before killing, check if session has active clients
- **Preserve work**: Warn if panes have running processes
- **Config backup**: Before editing `~/.tmux.conf`, suggest backup

## Confirmation Policy

**Read-only (always OK)**:
- `tmux ls`, `list-sessions`, `list-windows`, `list-panes`
- `tmux info`, `show-options`, `display-message`
- `tmux list-keys`, `list-buffers`

**Requires confirmation**:
- `kill-session`, `kill-window`, `kill-pane`
- `kill-server`
- Editing `~/.tmux.conf`
- `send-keys` to panes (can affect running processes)

## Environment Variables

| Variable | Description |
|----------|-------------|
| `TMUX` | Socket path (set inside tmux) |
| `TMUX_PANE` | Current pane ID |

Check if inside tmux: `[ -n "$TMUX" ]`

## Troubleshooting

| Issue | Solution |
|-------|----------|
| "no server running" | Start with `tmux` or `tmux new` |
| "sessions should be nested" | Unset `$TMUX` or use `tmux -u` |
| Detached session lost | Check `tmux ls`, attach with `tmux attach` |
| Colors not working | Set `TERM=xterm-256color` or `set -g default-terminal "tmux-256color"` |
| Mouse not working | `set -g mouse on` in config |

Related Skills

We are still matching the closest adjacent skills for this page. In the meantime, continue through the full directory.