Token导航 LogoToken导航TokenDH.com
效率执行命令clawhub未标认证来源可访问clear审计通过

openclaw-tmux-persistent-processOpenClaw tmux persistent process 效率

Agent Skill

openclaw-tmux-persistent-process 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

11,642

周安装

490

GitHub Stars

公开资料未说明

下载量

4,077
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-tmux-persistent-process(OpenClaw tmux persistent process 效率)
来源仓库:https://github.com/darwin7381/openclaw-tmux-persistent-process
安装命令:
openclaw skills install openclaw-tmux-persistent-process
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-tmux-persistent-process

简介

openclaw-tmux-persistent-process 用于在会话重启后保持后台进程持续运行。

  • 适合需要长时间运行的服务器、开发环境或隧道服务(如 ngrok)维护。
  • 通过 tmux 实现进程持久化,避免因网关清理导致中断。
  • 涉及系统级进程管理,需谨慎操作以防资源冲突或安全风险。
  • 适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
openclaw-tmux-persistent-process
description
>
Solves
exec background processes getting SIGKILL on session cleanup.

OpenClaw Tmux Persistent Process

Run programs that survive OpenClaw exec session cleanup and gateway restarts.

Why every OpenClaw user should have this

OpenClaw runs shell commands via exec. But exec has a critical limitation that most users don't realize until something breaks:

  • Background processes are tied to the exec session. When the session cleans up (idle timeout, context compaction, or gateway restart), all background processes receive SIGKILL and die immediately.
  • Gateway restarts kill everything. Updates, config changes, or openclaw gateway restart — all running exec processes are gone.
  • No warning. Your tunnel, dev server, or build task just silently disappears.

This means anything you expect to keep running — a tunnel for a client demo, a dev server, a long build — can die at any moment without notice.

The solution: Use tmux to create virtual terminals completely decoupled from the exec lifecycle. Programs in tmux survive gateway restarts, exec cleanup, and session timeouts. tmux runs independently of OpenClaw — even if the gateway goes down, your processes keep running.

Rule of thumb: If a command might run longer than 2 minutes, use tmux.


Socket convention

All operations use a dedicated socket to avoid interfering with the user's own tmux:

SOCK="/tmp/openclaw-tmux/openclaw.sock"
mkdir -p /tmp/openclaw-tmux

Start a process

SESSION="my-server"

# Check if already running
if tmux -S "$SOCK" has-session -t "$SESSION" 2>/dev/null; then
  echo "already running"
else
  tmux -S "$SOCK" new -d -s "$SESSION" \
    "cd /path/to/project && npm run dev"
  echo "started"
fi

Monitor

# List all sessions
tmux -S "$SOCK" list-sessions

# View last 30 lines of output
tmux -S "$SOCK" capture-pane -t "$SESSION" -p -S -30

# Check if process is idle (back to shell prompt)
tmux -S "$SOCK" capture-pane -t "$SESSION" -p -S -3 \
  | grep -qE '\$\s*$|❯' && echo "IDLE" || echo "RUNNING"

Interact

# Send a command
tmux -S "$SOCK" send-keys -t "$SESSION" "command" Enter

# Send literal text (recommended, no special key parsing)
tmux -S "$SOCK" send-keys -t "$SESSION" -l -- "literal text"
tmux -S "$SOCK" send-keys -t "$SESSION" Enter

# Ctrl+C to interrupt
tmux -S "$SOCK" send-keys -t "$SESSION" C-c

Stop / cleanup

# Kill one session
tmux -S "$SOCK" kill-session -t "$SESSION"

# Kill all
tmux -S "$SOCK" kill-server

# Clean stale socket
rm -f "$SOCK"

Start interactive programs (wait for ready)

For programs that need startup time (e.g. coding agents, REPLs):

SESSION="my-task"
tmux -S "$SOCK" new -d -s "$SESSION"
tmux -S "$SOCK" send-keys -t "$SESSION" "cd ~/project && node" Enter

# Wait for prompt before sending commands
for i in $(seq 1 15); do
  OUTPUT=$(tmux -S "$SOCK" capture-pane -t "$SESSION" -p -S -5)
  if echo "$OUTPUT" | grep -qE '❯|>\s*$|ready'; then
    break
  fi
  sleep 1
done

# Now safe to send input
tmux -S "$SOCK" send-keys -t "$SESSION" -l "your command"
tmux -S "$SOCK" send-keys -t "$SESSION" Enter

Common use cases

Use caseSession nameCommand example
Dev serverdev-servernpm run dev
Tunnel (ngrok)tunnel-ngrokngrok http 3000
Tunnel (localhost.run)tunnel-lrssh -R 80:localhost:3000 nokey@localhost.run
Background workerworkerpython worker.py
Build taskbuild-appnpm run build

Session naming

Lowercase + hyphens. No spaces.

dev-server       — development servers
tunnel-{name}    — tunnels (ngrok, cloudflared, etc.)
build-{project}  — build tasks
worker-{name}    — background workers

Important notes

  • Reboot = gone. tmux doesn't survive system restarts. Re-create sessions after reboot.
  • Scrollback limit. Default 2000 lines. Increase with: tmux set-option -t "$SESSION" history-limit 10000
  • Socket stale. If list-sessions says "error connecting", delete the socket and recreate.
  • Environment. tmux inherits env at creation time. Set vars in the command: tmux new -d -s name "export KEY=val && cmd"
  • No conflict. Dedicated socket means zero interference with user's own tmux.

Requirements

  • tmux 2.6+ (for send-keys -l literal mode)
  • Check: tmux -V
  • Install: brew install tmux (macOS) or apt install tmux (Linux)

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

70.86%
按下载量换算2,889

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install openclaw-tmux-persistent-process 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills