Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dwsy avatar

Tmux

  • 12 installs
  • 17 repo stars
  • Updated July 25, 2026
  • dwsy/agent

Lets an agent remote-control tmux sessions for interactive CLIs, background tasks and long-running services on a private socket, with session naming, state tracking and auto-cleanup of stale sessions.

About

tmux is a Claude Code skill that lets an agent remote-control tmux sessions for interactive CLIs, background tasks and long-running services, using a private socket, structured session naming and state tracking with automatic cleanup of stale sessions. A solo builder reaches for it so their agent can start, watch and drive terminal processes reliably without clobbering their personal tmux setup.

  • Agent-driven tmux control
  • Private socket, no conflict with personal tmux
  • Session categories: task, service, agent
  • Auto-cleanup of inactive sessions

Tmux by the numbers

  • 12 all-time installs (skills.sh)
  • Ranked #383 of 550 CLI & Terminal skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dwsy/agent --skill tmux

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs12
repo stars17
Last updatedJuly 25, 2026
Repositorydwsy/agent

What it does

Lets an agent remote-control tmux sessions for interactive CLIs, background tasks and long-running services on a private socket, with session naming, state tracking and auto-cleanup of stale sessions.

Who is it for?

Builders whose agent must drive interactive or long-running CLI processes

Skip if: Environments without tmux available

Files

SKILL.mdMarkdownGitHub ↗

tmux Skill

Core Concepts

Socket: /tmp/pi-tmux-sockets/pi.sock (private, no conflicts with personal tmux)

Session Naming: pi-{category}-{name}-{timestamp}

  • Categories: task (temporary), service (long-running), agent (agent-specific)

Session States: running | idle | exited

Persistence: /tmp/pi-tmux-sessions.json

Auto-cleanup: Inactive sessions > 24h removed (configurable)

CLI Commands

bun ~/.pi/agent/skills/tmux/lib.ts <command>

create <name> <command> [category]    # Create session, prints monitoring command
list [filter]                         # List sessions with status
status <id>                           # Session details
send <id> <keys>                      # Send keystrokes (literal mode, safe)
capture <id> [lines]                  # Capture pane output (default: 200)
kill <id>                             # Terminate session
cleanup [hours]                       # Remove old sessions (default: 24h)
attach <id>                           # Print attach command
sync                                  # Sync session state with tmux

TUI: bun ~/.pi/agent/skills/tmux/tui.ts (visual management, shortcuts: r/n/c/s/a/k/q)

TypeScript API

import { TmuxManager } from "~/.pi/agent/skills/tmux/lib.ts";

const tmux = new TmuxManager({ autoCleanup: false }); // optional config

// Session lifecycle
const session = await tmux.createSession(name, command, category);
await tmux.killSession(session.id);

// Output handling
const output = await tmux.capturePane(target, lines);
const success = await tmux.waitForText(target, pattern, { timeout: 60 });

// State management
const sessions = await tmux.listSessions(filter);
const status = await tmux.getSessionStatus(id);
await tmux.sync();
await tmux.cleanup(hours);

Key Rules

1. Always print monitoring command after session creation:

   tmux -S /tmp/pi-tmux-sockets/pi.sock attach -t {session-id}

2. Use `send` for interactive tools (Python REPL, gdb, databases):

   # Python REPL: always use PYTHON_BASIC_REPL=1
   bun ~/.pi/agent/skills/tmux/lib.ts create python "PYTHON_BASIC_REPL=1 python3 -q" task
   bun ~/.pi/agent/skills/tmux/lib.ts send pi-task-python-* "print('Hello')"

3. Category selection:

  • task: compilation, testing, temporary operations
  • service: dev servers, databases, persistent services
  • agent: training, data processing, agent-specific tasks

4. Safe key injection: send uses literal mode (-l), no shell escaping needed

5. Session recovery: Run sync if session not found

Helper Scripts

# Wait for text pattern with timeout
./scripts/wait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]

# List sessions with metadata
./scripts/find-sessions.sh -S "$SOCKET"
./scripts/find-sessions.sh --all

Requirements

  • tmux (Linux/macOS)
  • Bun runtime
  • Bash (helper scripts)

Related skills

CLI & Terminaldevopsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.