Awesome-omni-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.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/design/tmux-majiayu000" ~/.claude/skills/diegosouzapw-awesome-omni-skill-tmux-fbfcb5 && rm -rf "$T"
skills/design/tmux-majiayu000/SKILL.mdTmux 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:
-
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)
-
Send the command to that window.
tmux send-keys -t "server-log" "npm start" C-m(
simulates the Enter key)C-m
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 Type | Method |
|---|---|
| Simple shell command | |
| Single line, may have special chars | then |
| Multi-line text or instructions | + |
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
| Task | Command |
|---|---|
| Create window | |
| Run command | |
| Send literal text | |
| Send multi-line | |
| Read output | |
| Interrupt | |
| Kill window | |