Resilient Coding Agent for Openclaw

A specialized skill for decoupling long-running AI coding agents from the orchestrator using tmux for maximum task persistence.

cosformula
v0.5.0
Feb 18, 2026
0
862
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install resilient-coding-agent

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install resilient-coding-agent using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Resilient Coding Agent?

The Resilient Coding Agent skill is designed to manage long-running tasks for AI agents like Codex, Claude Code, and OpenCode. By decoupling the agent process from the primary orchestrator using tmux, it ensures that coding tasks continue to run even if the orchestrator restarts, crashes, or experiences network drops. This architecture provides a robust execution environment for complex engineering tasks that exceed typical session timeouts.

Built with security and reliability in mind, this skill leverages isolated temporary directories and secure prompt handling to prevent shell injection. It is an essential component for developers using Openclaw Skills who require fire-and-forget execution with automated recovery and completion notification systems.

Resilient Coding Agent Use Cases

  • Executing complex refactoring tasks that are expected to take more than 5 minutes.
  • Running autonomous coding agents in environments where the orchestrator might undergo periodic restarts.
  • Managing multiple concurrent coding tasks without losing progress due to process interruptions.
  • Monitoring agent progress asynchronously through scrollback capture without being attached to the active process.

How Resilient Coding Agent Works

  1. The orchestrator creates a secure, unique temporary directory using mktemp to store prompt files and event logs.
  2. A named tmux session is initialized using a standardized naming convention (e.g., codex-task-name).
  3. The coding agent is launched within the tmux session, with the task prompt passed securely via file reference rather than shell interpolation.
  4. For agents like Codex, the skill captures the specific session ID from the event log to enable precise resumption later.
  5. An optional health monitor loop periodically checks the session status and captures output panes to detect completion or crashes.
  6. Upon completion or detected failure, the skill either triggers a notification or executes agent-native resume commands to recover the task.

Resilient Coding Agent Setup

Ensure tmux and your preferred coding agent (Codex, Claude Code, OpenCode, or Pi) are installed in your environment. To initialize a resilient session, use the following pattern:

# Create secure temp directory
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"

# Launch the agent in a detached tmux session
tmux new-session -d -s codex-my-task -e "TASK_TMPDIR=$TMPDIR"
tmux send-keys -t codex-my-task 'cd /your/project/dir && codex exec --full-auto "$(cat $TASK_TMPDIR/prompt)" && echo "__TASK_DONE__"' Enter

Resilient Coding Agent Data Schema & Taxonomy

The skill organizes its operational data within a temporary directory ($TMPDIR) to maintain isolation and security:

File Description
prompt The raw task instructions written by the orchestrator.
events.jsonl Streaming output and logs from the coding agent.
codex-session-id Extracted thread ID used for resuming specific tasks.
done A marker file indicating successful task completion.

Resilient Coding Agent Advanced Features

  • Secure Prompt Handling: Prevents command injection by referencing prompt files via cat inside double quotes.
  • Automated Health Monitoring: Supports active monitoring loops that detect shell prompts or exit indicators to trigger auto-recovery.
  • Completion Hooks: Chainable notifications via macOS osascript or system events for immediate feedback.
  • Session Decoupling: Survival of tasks through orchestrator restarts by utilizing tmux as a persistent process host.
  • Precise Session Recovery: Uses extracted metadata to resume specific agent threads rather than relying on unsafe --last flags.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*