tmux-sessions
Installation
SKILL.md
Tmux Sessions
Overview
Use tmux to manage background processes, run dev servers, and execute parallel tasks without blocking the main terminal.
Quick Reference
Create and manage sessions
# New named session
tmux new-session -d -s dev-server
# List sessions
tmux list-sessions
# Attach to session
tmux attach -t dev-server
# Kill session
tmux kill-session -t dev-server
Send commands to a session
# Run a command in a detached session
tmux send-keys -t dev-server 'npm run dev' Enter
# Send Ctrl+C to stop
tmux send-keys -t dev-server C-c
Read session output
# Capture last 200 lines of output
tmux capture-pane -p -t dev-server -S -200
Common Patterns
Dev Server in Background
tmux new-session -d -s server
tmux send-keys -t server 'npm run dev' Enter
# ... work on other things ...
tmux capture-pane -p -t server -S -50 # Check logs
tmux send-keys -t server C-c # Stop server
tmux kill-session -t server
Parallel Test Runs
tmux new-session -d -s test-unit
tmux new-session -d -s test-e2e
tmux send-keys -t test-unit 'npm run test:unit' Enter
tmux send-keys -t test-e2e 'npm run test:e2e' Enter
# Check results
tmux capture-pane -p -t test-unit -S -20
tmux capture-pane -p -t test-e2e -S -20
Watch Build Output
tmux new-session -d -s build
tmux send-keys -t build 'npm run build:watch' Enter
# Periodically check
tmux capture-pane -p -t build -S -10
Tips
- Always use
-d(detached) when creating sessions from scripts - Use descriptive session names:
dev-server,test-runner,build-watch - Clean up sessions when done:
tmux kill-serverremoves all - For interactive TUI apps, send text and Enter separately with a small delay:
tmux send-keys -t target -l "command" && sleep 0.1 && tmux send-keys -t target Enter - Capture output with
-S -200to get enough context (last 200 lines)
Related skills
More from phuetz/code-buddy
blender
Blender 3D modeling, animation, and rendering automation via Python bpy scripting and CLI
19figma
Automate Figma design workflows via REST API, Plugin API, and MCP integration
3github
Interact with GitHub using the gh CLI for issues, PRs, CI runs, releases, and API queries
3ableton-live
Ableton Live music production automation via OSC protocol, MIDI, and Max for Live
3gitlab
GitLab DevOps platform with CI/CD pipelines, API automation, and glab CLI control
3csharp-avalonia
Cross-platform desktop/mobile development with C# and Avalonia UI
3