← 返回
数据分析 中文

Persistent Code Terminal

Persistent per-project coding terminal (tmux). Run Codex CLI (codex exec) inside a stable session; mobile/SSH friendly.
持久的跨项目编码终端(tmux)。在稳定会话中运行 Codex CLI(codex exec);支持移动端/SSH访问。
justinzhq
数据分析 clawhub v1.2.0 1 版本 99916.9 Key: 无需
★ 1
Stars
📥 2,386
下载
💾 50
安装
1
版本
#latest

概述

persistent-code-terminal

A persistent coding terminal for OpenClaw. It creates a tmux session per project:

-code-session

This makes terminal-first AI coding (Codex CLI / Claude Code / any CLI tool) reliable and mobile/SSH friendly:

  • detach/reattach without losing output
  • keep shell state across turns
  • keep long-running tasks alive (dev server, watch mode, etc.)

OpenClaw natural-language routing

When user intent is "use natural language to drive Codex CLI in this repo", route through this skill first.

Intelligent auto-trigger:

  • Routing toggle: openclaw.config.dev.autoCodeRouting (default false).
  • If enabled, route coding workflow messages via:
  • {baseDir}/bin/persistent-code-terminal-route.sh ""
  • The route script applies:
  • intent detection (code change / fix / test / build / commit / push / codex phrases)
  • safety filtering (must be git repo + action verbs; bypass on 不要执行,只分析)
  • execution chain:
  • persistent-code-terminal-auto.sh --max-retries 3 --instruction ""
  • persistent-code-terminal-summary.sh --lines 120
  • fallback for missing deps (tmux/codex) with doctor guidance.

Multi-project routing:

  • One message can include multiple project tasks split by newline / / ;
  • Supported patterns:
  • 项目
  • 项目:
  • 修复/增加/修改 ...
  • 项目 ...; 项目 ...
  • Execution is serial per project:
  • start.sh --project
  • auto.sh --max-retries 3 --instruction ""
  • summary.sh --lines 120 --json
  • Invalid/unknown project tasks are reported as failed without blocking other tasks.

Trigger shortcuts (recommended):

  • If user message starts with codex , treat the remaining text as instruction.
  • Execute:
  • {baseDir}/bin/persistent-code-terminal-codex-exec.sh ""
  • Then report with:
  • {baseDir}/bin/persistent-code-terminal-status.sh
  • {baseDir}/bin/persistent-code-terminal-summary.sh --lines 120

Preferred execution pattern in chat-driven runs:

  • start.sh (or implicit auto-create from send.sh)
  • codex-exec.sh "" for Codex-driven work
  • status.sh / summary.sh for concise progress reporting

If user says "检查项目/继续会话/跑测试并总结", use this skill scripts instead of asking user to type long shell commands.

Core model (must follow)

start → send → read → decide

1) Start/ensure session:

  • {baseDir}/bin/persistent-code-terminal-start.sh

2) Send ONE command:

  • {baseDir}/bin/persistent-code-terminal-send.sh ""
  • Appends a pane sentinel on completion: __PCT_EXIT_CODE__N
  • Supports: --timeout , --dry-run, --phase

3) Read output:

  • {baseDir}/bin/persistent-code-terminal-read.sh
  • Parses the latest sentinel and updates .pct-state.json

4) Check state quickly (optional):

  • {baseDir}/bin/persistent-code-terminal-status.sh
  • {baseDir}/bin/persistent-code-terminal-summary.sh --lines 120
  • {baseDir}/bin/persistent-code-terminal-doctor.sh
  • {baseDir}/bin/persistent-code-terminal-list.sh (list *-code-session)
  • {baseDir}/bin/persistent-code-terminal-switch.sh --project

State file:

  • .pct-state.json (current project directory)
  • Fields: projectDir, session, lastCommand, lastExitCode, phase, updatedAt

Structured output:

  • {baseDir}/bin/persistent-code-terminal-read.sh --json
  • {baseDir}/bin/persistent-code-terminal-summary.sh --json
  • {baseDir}/bin/persistent-code-terminal-auto.sh --json

Codex-first workflow (one-shot)

If Codex CLI is installed as codex, prefer:

  • {baseDir}/bin/persistent-code-terminal-codex-exec.sh ""
  • Default behavior uses:
  • codex exec --full-auto --sandbox workspace-write --cd ""
  • You can pass additional flags before the instruction:
  • {baseDir}/bin/persistent-code-terminal-codex-exec.sh --json -o /tmp/codex.json ""
  • Set PCT_CODEX_NO_DEFAULT_FLAGS=1 to disable default flags.

Example:

  • {baseDir}/bin/persistent-code-terminal-codex-exec.sh "Implement feature X. Ensure build and tests pass. Commit and push to current branch. Do NOT force push."

Safety

  • Never git push --force unless user explicitly requests.
  • Keep secrets out of terminal output.
  • Prefer feature branches; avoid direct pushes to main/master unless explicitly requested.
  • For network/privileged actions (for example git push), follow active Codex approval/sandbox policy.

版本历史

共 1 个版本

  • v1.2.0 当前
    2026-03-29 01:56 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,034
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,265
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 166 📥 60,259