Manage long-running shell sessions with tmux — start a detached session, run a long task, reattach later, capture output. Use when a task takes longer than a single tool call (build, test, log tail).
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# tmux — long-running session management
`tmux` is on PATH in the gateway. Sessions persist across tool-call
boundaries within the same agent's lifetime, so you can fire off a long task
and come back to it on the next heartbeat.
## Start a detached session
```bash
# Run a long command in a fresh detached session named "build"
tmux new-session -d -s build "npm run build > /tmp/build.log 2>&1"
```
## Check on a session
```bash
# List sessions
tmux list-sessions
# Capture the current pane's visible output
tmux capture-pane -t build -p | tail -40
# Capture the full scrollback (last 1000 lines)
tmux capture-pane -t build -p -S -1000
```
## Send input to a session
```bash
# Send a command (note: end with C-m for Enter)
tmux send-keys -t build "echo done > /tmp/done.flag" C-m
```
## End a session
```bash
tmux kill-session -t build
```
## Common patterns
### Long-running build with status flag
```bash
tmux new-session -d -s build "
npm run build > /tmp/build.log 2>&1
echo \$? > /tmp/build.exit
"
# Later (next heartbeat):
if [ -f /tmp/build.exit ]; then
EXIT=\$(cat /tmp/build.exit)
echo "Build finished with exit code \$EXIT"
tail -20 /tmp/build.log
else
…
The line at the top of this page pins the label git:20260504.69c67bb, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_qlmtoggsequrx22n
GET https://markdownregistry.com/api/v1/resolve?ref=team-commonly/commonly/tmux
GET https://markdownregistry.com/api/v1/blob/8b3e2743cb9440723397154b91884a53c8d29642475cdd23688c150c35e309f3
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
team-commonly/commonly · backend/commonly-bundled-skills/github/SKILL.md · Interact with GitHub (issues, PRs, repos, releases) using the `gh` CLI. Use when asked to read or write GitHub state —…
team-commonly/commonly · backend/commonly-bundled-skills/officecli/skills/morph-ppt-3d/SKILL.md · 3D Morph PPT — extends morph-ppt with GLB model insertion, cinematographic camera, model-content layout, and enriched…
team-commonly/commonly · backend/commonly-bundled-skills/officecli/skills/morph-ppt/SKILL.md · Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions…
team-commonly/commonly · backend/commonly-bundled-skills/officecli/skills/officecli-commonly-templates/SKILL.md · Use this skill when producing a polished, Commonly-branded deliverable (.docx brief / memo, .xlsx data matrix, .pptx…
team-commonly/commonly · backend/commonly-bundled-skills/officecli/skills/officecli-data-dashboard/SKILL.md · Use this skill to build a multi-element Excel dashboard — Dashboard sheet on open, multiple formula-driven KPI cards…
team-commonly/commonly · backend/commonly-bundled-skills/officecli/skills/officecli-docx/SKILL.md · Use this skill any time a .docx file is involved -- as input, output, or both. This includes: creating Word documents…