tmux-background-tasks
Run and manage long-lived background commands using tmux sessions instead of background processes. Use when starting backend/API servers, Expo/React Native dev servers, job workers, watchers, or any task that should keep running while other commands are executed.
How do I install this agent skill?
npx skills add https://github.com/justbecauselabs/agent-skills --skill tmux-background-tasksIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides instructions for managing background tasks using the tmux terminal multiplexer. It allows an AI agent to start, stop, and monitor persistent processes like servers or workers. The primary security consideration is the indirect prompt injection surface associated with executing commands derived from user input or project files.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Tmux Background Tasks
If tmux is not installed, stop and ask the user to install it before proceeding.
Overview
Use tmux to run and manage long-lived commands in the background. Do not keep these tasks alive with the default process tool; always launch them in tmux so they survive across commands and can be reattached.
Workflow
-
Verify tmux is installed If tmux is missing, stop and ask the user to install it (e.g.,
brew install tmuxon macOS). Do not proceed until tmux is available. -
Pick a stable session name Use a predictable, unique name like
<repo>-<task>(e.g.,myapp-api,myapp-expo). -
Start or reuse the session Check for an existing session before starting a new one.
-
Provide attach/detach guidance Tell the user how to attach to the session if they want to view logs or interact.
-
Stop or restart when requested Terminate the session cleanly when the user asks to stop the task.
Command Patterns
Check tmux:
command -v tmuxtmux -V
Create a new detached session running a command:
tmux new-session -d -s <name> -- <command>- If you need a login shell or env:
tmux new-session -d -s <name> -- bash -lc '<command>'
Reuse or attach:
tmux has-session -t <name>tmux attach -t <name>tmux ls
Send a stop signal or kill:
tmux send-keys -t <name> C-ctmux kill-session -t <name>
Peek at recent output (non-interactive):
tmux capture-pane -pt <name> -S -200
Notes
- Prefer tmux for servers, watchers, workers, and dev tools that should remain running while other commands execute.
- Avoid creating duplicate sessions. If
tmux has-session -t <name>succeeds, reuse it or attach.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/justbecauselabs/agent-skills/tmux-background-tasks">View tmux-background-tasks on skillZs</a>