Resilient Claude Agent for Openclaw

A robust execution layer that decouples Claude Code from the orchestrator using tmux for persistent, crash-resistant coding tasks.

mattmartinez
v1.0.17
Apr 5, 2026
0
913
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install resilient-claude-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-claude-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 Claude Agent?

The Resilient Claude Agent is a specialized skill designed to handle long-running coding tasks that are vulnerable to orchestrator restarts, process crashes, or network interruptions. By leveraging tmux to isolate the execution environment, this skill provides a stable platform for autonomous coding. It is a critical addition to any suite of Openclaw Skills, allowing users to delegate complex tasks like refactoring or debugging without needing to maintain an active connection.

This skill operates under a fire-and-forget philosophy, utilizing the --dangerously-skip-permissions flag to ensure Claude Code can execute bash commands and file modifications without human intervention. It includes a comprehensive monitoring system that watches for process health and output staleness, automatically resuming sessions if a failure is detected.

Resilient Claude Agent Use Cases

  • Long-running architectural refactoring and codebase migrations.
  • Automated test suite generation and iterative debugging cycles.
  • Deep file exploration and documentation generation for large projects.
  • Background security analysis and code review tasks.
  • Maintaining persistent coding sessions in environments with unstable network connectivity.

How Resilient Claude Agent Works

  1. The skill initializes a secure, isolated temporary directory to manage the task lifecycle.
  2. A background tmux session is created, ensuring the coding process is decoupled from the parent shell context.
  3. The skill captures real-time output through a pipe-pane mechanism that strips ANSI escape codes for clean logging.
  4. A wrapper script launches Claude Code, delivering prompts via stdin to prevent sensitive data from appearing in process lists.
  5. A dedicated health monitor script runs with nohup to track PIDs, detect hangs, and trigger automatic session resumes using the claude -c command.

Resilient Claude Agent Setup

To utilize this skill within your Openclaw Skills environment, ensure you have tmux and the Claude Code CLI installed. The setup follows a specific sequence:

# Create a secure workspace
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"

# The orchestrator writes task details to a manifest
# and launches the monitor script in the background
nohup bash scripts/monitor.sh claude-<task-name> "$TMPDIR" >"$TMPDIR/monitor.log" 2>&1 &

Resilient Claude Agent Data Schema & Taxonomy

The skill organizes its state within a temporary directory using a structured manifest system:

File Purpose
manifest Structured task state (status, PID, model, start time).
output.log Sanitized continuous output capture from the tmux pane.
prompt The raw task instructions delivered to Claude.
done A completion marker file indicating the task lifecycle is finished.
exit_code The numeric return code of the final Claude process.
pid The current active process ID for the Claude Code agent.

Resilient Claude Agent Advanced Features

  • Layered health detection prioritizes done-file checks over PID liveness to prevent race conditions.
  • Exponential backoff strategy for monitoring intervals to optimize system resources during failures.
  • Pane state classification that detects waiting input prompts or internal agent crashes.
  • Automatic session cleanup and abandonment protocols to prevent orphan processes.
  • Secure prompt handling that bypasses shell interpolation for improved security and reliability.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*