Agent skill
tmux
Manage concurrent background processes using tmux. Use when spawning dev servers, running long-running tasks, monitoring multiple processes, or capturing output from background commands without blocking the main session.
Install this agent skill to your Project
npx add-skill https://github.com/iamhenry/ai-project-starter-kit/tree/main/.opencode/skills/tmux
SKILL.md
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:
-
Create a new detached window with a specific name. This keeps it isolated and easy to reference.
bashtmux new-window -n "server-log" -d(Replace "server-log" with a relevant name for your task)
-
Send the command to that window.
bashtmux send-keys -t "server-log" "npm start" C-m(
C-msimulates the Enter key)
3. 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.
4. 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"
5. 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
Summary of Pattern
tmux new-window -n "ID" -dtmux send-keys -t "ID" "CMD" C-mtmux capture-pane -p -t "ID"
6. Multi-Model Fan Out Pattern
Used when you want to get perspectives from multiple AI models in parallel (e.g., GPT-5.2, Gemini Pro).
Setup
# Kill existing session, create new with multiple windows
tmux kill-session -t model-consult 2>/dev/null
tmux new-session -d -s model-consult -n gpt5 ';' new-window -t model-consult -n gemini
Send Queries
Use heredoc to avoid quote escaping issues:
tmux send-keys -t model-consult:gpt5 'cat <<EOF | opencode run --model openai/gpt-5.2 -
Your prompt here
EOF
echo ###DONE###' C-m
Poll for Completion
tmux capture-pane -p -S - -t model-consult:gpt5 | tail -50
# Look for ###DONE### marker
Poll every ~10 seconds. Queries typically take 2-5 minutes.
Capture Full Output
tmux capture-pane -p -S - -t model-consult:gpt5
The -S - flag captures full scrollback history, not just visible screen.
Cleanup
tmux kill-session -t model-consult
Model Aliases Reference
| Alias | Model ID |
|---|---|
| GPT | openai/gpt-5.2 |
| Gemini Pro | google/gemini-3-pro-preview |
Run opencode models for full list.
Key Learnings
- USE HEREDOC (
cat <<EOF) to avoid quote escaping nightmares - ADD
###DONE###marker to know when query completes - USE
-S -flag withcapture-paneto get full scrollback - POLL every 10 seconds - queries can take 2-5 minutes
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
verification-gate
Reusable verification gate for completed work before commit or merge. Use when implementation is done and Claude must prove the task works, verify the main user flow, choose between browser-flow, browser-static, or non-browser validation, and return a PASS/FAIL/BLOCKED verdict with evidence. When browser verification is needed, rely on the agent-browser skill for browser actions, screenshots, and recordings.
osgrep
Semantic code search using natural language queries. Use when users ask "where is X implemented", "how does Y work", "find the logic for Z", or need to locate code by concept rather than exact text. Returns file paths with line numbers and code snippets.
napkin
Maintain a per-repo napkin file that tracks mistakes, corrections, and what works. Activates EVERY session, unconditionally. Read the napkin before doing anything. Write to it continuously as you work — not just at session boundaries. Log your own mistakes, not just user corrections. The napkin lives in the repo at `.opencode/napkin.md`.
dogfood
Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.
viral-research
Viral content research and DNA extraction for Instagram Reels. Use this skill whenever you need to research what's performing in a niche on Instagram, find viral faceless Reels, download and analyze them frame-by-frame, identify patterns, and produce a structured research brief. Trigger whenever the user mentions viral content research, Instagram research, Reel analysis, content DNA, swipe file building, niche research, competitor analysis for social content, or wants to understand why certain content performs. Also trigger when the user wants to find content formats to adapt, study what's working in a niche, or build a research-backed content strategy. This skill is research-only — it does not generate or publish content.
import-github-dirs
Import specific directories from external GitHub repos without cloning. Uses tarball extraction to pull only what you need. TRIGGER when user wants to copy files/folders from another repo.
Didn't find tool you were looking for?