Skip to content
tmux logo

Tmux Skill

tmux

Manage concurrent processes using tmux. Use when running servers, long tasks, or orchestrating multiple agents in separate panes. Essential for sending multi-line text or instructions to other tmux panes safely.

SKILL.md

Full skill instructions

Tmux Skill

This skill empowers you to manage multiple concurrent processes (like servers, watchers, or long builds) using tmux directly from the Bash tool.

Since you are likely already running inside a tmux session, you can spawn new windows or panes to handle these tasks without blocking your main communication channel.

1. Verify Environment & Check Status

First, verify you are running inside tmux:

echo $TMUX

If this returns empty, you are not running inside tmux and these commands will not work as expected.

Once verified, check your current windows:

tmux list-windows

2. Spawn a Background Process

To run a command (e.g., a dev server) in a way that persists and can be inspected:

  1. Create a new detached window with a specific name. This keeps it isolated and easy to reference.

    tmux new-window -n "server-log" -d
    

    (Replace "server-log" with a relevant name for your task)

  2. Send the command to that window.

    tmux send-keys -t "server-log" "npm start" C-m
    

    (C-m simulates the Enter key)

3. Sending Text to Panes

Warning: send-keys interprets control sequences. Multi-line text or text with special characters can trigger tmux modes (like C-r for search). Use the right method:

Content TypeMethod
Simple shell commandsend-keys "cmd" C-m
Single line, may have special charssend-keys -l "text" then send-keys C-m
Multi-line text or instructionsload-buffer + paste-buffer

Literal mode (-l flag) prevents interpreting escape sequences:

tmux send-keys -l -t "target" "text with C-r and other chars"
tmux send-keys -t "target" C-m

Multi-line content — always use load-buffer:

cat > /​tmp/​msg.txt << 'EOF'
Your multi-line content here.
Can include any characters safely.
EOF
tmux load-buffer /​tmp/​msg.txt && tmux paste-buffer -t "target"
tmux send-keys -t "target" C-m

4. Interacting with Other Agents

When sending instructions to another Claude instance running in a tmux pane:

cat > /​tmp/​instructions.txt << 'EOF'
Fix the authentication bug in src/​auth.ts:
1. The token validation is missing null checks
2. Add proper error handling for expired tokens
EOF
tmux load-buffer /​tmp/​instructions.txt && tmux paste-buffer -t %31
tmux send-keys -t %31 C-m

Never use send-keys directly for prompts or instructions — the text will likely contain characters that trigger tmux modes.

5. Inspect Output (Read Logs)

You can read the output of that pane at any time without switching your context.

Get the current visible screen:

tmux capture-pane -p -t "server-log"

Get the entire history (scrollback):

tmux capture-pane -p -S - -t "server-log"

Use this if the output might have scrolled off the screen.

6. Interact with the Process

If you need to stop or restart the process:

Send Ctrl+C (Interrupt):

tmux send-keys -t "server-log" C-c

Kill the window (Clean up):

tmux kill-window -t "server-log"

7. Advanced: Chaining Commands

You can chain multiple tmux commands in a single invocation using ';' (note the quotes to avoid interpretation by the shell). This is faster and cleaner than running multiple tmux commands.

Example: Create window and start process in one go:

tmux new-window -n "server-log" -d ';' send-keys -t "server-log" "npm start" C-m

Quick Reference

TaskCommand
Create windowtmux new-window -n "ID" -d
Run commandtmux send-keys -t "ID" "cmd" C-m
Send literal texttmux send-keys -l -t "ID" "text"
Send multi-linetmux load-buffer file && tmux paste-buffer -t "ID"
Read outputtmux capture-pane -p -t "ID"
Interrupttmux send-keys -t "ID" C-c
Kill windowtmux kill-window -t "ID"

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View