tmux-patterns

Manage tmux panes and windows programmatically with reliable targeting.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mshuffett/dotfiles --skill tmux-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tmux-patterns
Source: https://github.com/mshuffett/dotfiles/tree/main/agents/knowledge/atoms/claude-skill-archive/tmux-patterns
Command: npx skills add https://github.com/mshuffett/dotfiles --skill tmux-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear, actionable guidance on how to effectively manage tmux panes, ensuring commands are sent to the correct window and pane, and preventing common errors related to pane switching.

Core Features & Use Cases

  • Pane Detection: Learn how to reliably get the current pane ID using $TMUX_PANE or tmux display-message.
  • Pane Manipulation: Execute commands for splitting, resizing, selecting, and closing panes.
  • Use Case: When you need to run a long-running process in a new pane while keeping your current work visible, this skill guides you on how to split the window, execute the command in the new pane, and optionally return focus to your original pane.

Quick Start

Use the tmux-patterns skill to split the current pane horizontally and run 'htop' in the new pane.

Frequently Asked Questions about tmux-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send a command to a specific tmux pane programmatically?

To send commands to specific tmux panes programmatically, you can reliably target them using the `$TMUX_PANE` environment variable or by parsing the output of `tmux display-message` to ensure your command execution hits the correct window and pane.

What is the best way to split a tmux window and run a command in the new pane?

The best way to manage tmux pane creation is to split the current window horizontally or vertically, execute your long-running command in the newly created pane, and then optionally return focus to your original pane to continue working.

How do I get the current tmux pane ID for script automation?

You can get the current tmux pane ID for terminal automation by accessing the `$TMUX_PANE` environment variable directly, or by invoking `tmux display-message` to dynamically retrieve pane identifiers during command execution.

Why does my tmux command execute in the wrong pane during automation?

Commands execute in the wrong tmux pane when dynamic pane targeting fails. Prevent this by using reliable variables like `$TMUX_PANE` and direct `tmux` commands for pane manipulation, ensuring your command execution targets the intended window.

Can I manage tmux pane layouts and resizing programmatically?

Yes, you can manage tmux layouts programmatically by applying patterns for splitting, resizing, selecting, and closing panes, which allows you to dynamically adjust terminal workflow layouts within your active tmux sessions.