# Send Persistent Code Terminal to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "persistent-code-terminal",
    "name": "Persistent Code Terminal",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Justinzhq/persistent-code-terminal",
    "canonicalUrl": "https://clawhub.ai/Justinzhq/persistent-code-terminal",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/persistent-code-terminal",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=persistent-code-terminal",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      ".github/workflows/ci.yml",
      "CHANGELOG.md",
      "README.md",
      "RELEASE.md",
      "SKILL.md",
      "bin/persistent-code-terminal-attach.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "persistent-code-terminal",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T01:44:26.333Z",
      "expiresAt": "2026-05-14T01:44:26.333Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=persistent-code-terminal",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=persistent-code-terminal",
        "contentDisposition": "attachment; filename=\"persistent-code-terminal-1.2.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "persistent-code-terminal"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/persistent-code-terminal"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/persistent-code-terminal",
    "downloadUrl": "https://openagent3.xyz/downloads/persistent-code-terminal",
    "agentUrl": "https://openagent3.xyz/skills/persistent-code-terminal/agent",
    "manifestUrl": "https://openagent3.xyz/skills/persistent-code-terminal/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/persistent-code-terminal/agent.md"
  }
}
```
## Documentation

### persistent-code-terminal

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

<project-name>-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 "<user message>"


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 "<message>"
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:

给 <project> 项目 <instruction>
给<project>项目：<instruction>
为 <project> 修复/增加/修改 ...
<project> 项目 ...；<project> 项目 ...


Execution is serial per project:

start.sh --project <project>
auto.sh --max-retries 3 --instruction "<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 "<remaining text>"


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 "<instruction>" 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

Start/ensure session:

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

Send ONE command:

{baseDir}/bin/persistent-code-terminal-send.sh "<command>"

Appends a pane sentinel on completion: __PCT_EXIT_CODE__N
Supports: --timeout <seconds>, --dry-run, --phase <name>

Read output:

{baseDir}/bin/persistent-code-terminal-read.sh

Parses the latest sentinel and updates .pct-state.json

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 <name>

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 "<instruction>"
Default behavior uses:

codex exec --full-auto --sandbox workspace-write --cd <current-dir> "<instruction>"


You can pass additional flags before the instruction:

{baseDir}/bin/persistent-code-terminal-codex-exec.sh --json -o /tmp/codex.json "<instruction>"


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.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: Justinzhq
- Version: 1.2.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-07T01:44:26.333Z
- Expires at: 2026-05-14T01:44:26.333Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/persistent-code-terminal)
- [Send to Agent page](https://openagent3.xyz/skills/persistent-code-terminal/agent)
- [JSON manifest](https://openagent3.xyz/skills/persistent-code-terminal/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/persistent-code-terminal/agent.md)
- [Download page](https://openagent3.xyz/downloads/persistent-code-terminal)