← Back to Skills Marketplace
ramsbaby

OpenClaw Self-Healing System

by Ramsbaby · GitHub ↗ · v3.1.1
cross-platform ⚠ suspicious
4792
Downloads
2
Stars
15
Active Installs
10
Versions
Install in OpenClaw
/install openclaw-self-healing
Description
4-tier autonomous self-healing and auto-recovery system for OpenClaw Gateway. Monitors gateway health, auto-restarts on crash, detects OAuth token expiry, ki...
README (SKILL.md)

OpenClaw Self-Healing System

"The system that heals itself — or calls for help when it can't."

A 4-tier autonomous recovery system for OpenClaw Gateway, featuring AI-powered diagnosis via Claude Code. Tested in production on macOS + Linux.

Architecture

Level 1: config-watch        → Config file change detection + instant reload
Level 2: Watchdog v4.4       → OAuth detection, zombie kill, exponential backoff
Level 3: Claude Code Doctor  → AI-powered diagnosis & repair (30 min window) 🧠
Level 4: Discord/Telegram    → Human escalation with full context

What's New in v3.1.0

  • Complete healing chain fix — config-watch → Watchdog → Emergency Recovery now fully connected
  • Installer rewrite — single install.sh covers macOS (LaunchAgent) + Linux (systemd)
  • Watchdog v4.4 — OAuth token expiry detection, zombie process auto-kill, Exponential Backoff
  • Emergency Recovery v2 — persistent learning repo, reasoning logs, multi-model support (Claude Code + Aider)
  • Metrics dashboard — success rate, MTTR, trending analysis via tmux

Quick Setup

bash \x3C(curl -fsSL https://raw.githubusercontent.com/Ramsbaby/openclaw-self-healing/main/install.sh)

Or install via ClawHub:

npx clawhub@latest install openclaw-self-healing

The 4 Tiers in Detail

Level Script Trigger Action
L1 config-watch.sh Config file change Validate + reload gateway
L2 gateway-watchdog.sh Process down / HTTP fail Kill zombie → restart → backoff
L3 emergency-recovery-v2.sh 30min continuous failure Claude Code PTY diagnosis
L4 emergency-recovery-monitor.sh L3 triggered Discord + Telegram alert

Configuration

All settings via environment variables in ~/.openclaw/.env:

Variable Default Description
DISCORD_WEBHOOK_URL (none) Discord webhook for L4 alerts
OPENCLAW_GATEWAY_URL http://localhost:18789/ Gateway health check URL
HEALTH_CHECK_MAX_RETRIES 3 Restart attempts before L3 escalation
EMERGENCY_RECOVERY_TIMEOUT 1800 Claude recovery timeout (30 min)

Verified Recovery Cases

  • OAuth token expiry — Watchdog v4.4 detects 401 in logs, restarts before agent dies
  • Zombie process — Preflight detects PID mismatch, SIGKILL + launchctl kickstart
  • Config schema erroropenclaw doctor --fix auto-applied on exit_1 pattern
  • Level 3 triggered — Claude Code diagnosed and fixed broken config in \x3C 15 min

Links

License

MIT — built by @ramsbaby + Jarvis 🦞

Usage Guidance
Install only if you intentionally want a persistent self-healing system with authority to restart OpenClaw and let Claude Code attempt repairs. Inspect the included install.sh and scripts first, prefer a pinned release over curl/bash from main, back up ~/.openclaw configuration, keep webhook channels private, and consider disabling or manually gating the Level 3 AI repair path until you trust the behavior.
Capability Analysis
Type: OpenClaw Skill Name: openclaw-self-healing Version: 3.1.1 The bundle implements a multi-tiered 'self-healing' system that grants an AI agent (Claude Code or Aider) broad shell access to autonomously diagnose and repair the OpenClaw Gateway. It establishes persistence via LaunchAgents (macOS) and systemd (Linux) and exfiltrates system logs and recovery reports to external Discord and Telegram webhooks. While these high-risk capabilities (AI-driven RCE, persistence, and network communication) are aligned with the stated purpose of autonomous recovery, they create a significant attack surface for prompt injection and unauthorized system modification. Key files include emergency-recovery-v2.sh (AI orchestration), gateway-watchdog.sh (process management), and install.sh (persistence setup).
Capability Assessment
Purpose & Capability
The self-healing purpose is coherent with monitoring and restarts, but the artifacts describe autonomous AI diagnosis and repair of the local OpenClaw environment, including config fixes and process control, without clearly bounded paths or approval steps.
Instruction Scope
The visible instructions describe automatic escalation to Claude Code for a 30-minute repair window and auto-applied fixes; the reviewed artifacts do not show clear human confirmation, dry-run mode, or modification limits.
Install Mechanism
Installation uses normal package managers for tmux, Claude Code, and jq, but the quick setup recommends executing an unpinned remote install script from GitHub main via curl/bash.
Credentials
Killing zombie processes, restarting the gateway, and changing OpenClaw configuration are proportionate to self-healing, but they are high-impact local mutations when performed autonomously by a background system.
Persistence & Privilege
The skill is designed to run persistently through LaunchAgent/systemd/timers/cron and can continue taking recovery actions after installation; this is disclosed but materially increases the impact of any bad diagnosis or misconfiguration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install openclaw-self-healing
  3. After installation, invoke the skill by name or use /openclaw-self-healing
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v3.1.1
v3.1.1: Improved search discoverability. Same features as v3.1.0.
v3.1.0
v3.1.0: Complete healing chain fix. Watchdog v4.4 with OAuth detection + zombie kill + exponential backoff. Emergency Recovery v2 with persistent learning. Installer rewrite for macOS+Linux.
v2.0.2
🐛 Hotfix: Discord webhook HTTP 404 버그 수정 - DISCORD_WEBHOOK_URL 의존성 제거 - stdout으로 알림 출력 → 크론 delivery 자동 전달 - 설정 복잡도 제거 - 실제 장애 시나리오로 검증 완료
v2.0.1
Major update introducing persistent learning, reasoning logs, and expanded alerting. - Added persistent learning with automatic documentation of failures and fixes. - Introduced reasoning logs to explain AI-driven recovery actions. - Expanded alerts to support both Discord and Telegram. - Added metrics dashboard script for visualizing recovery statistics. - New documentation and contributor guides. - Requires new dependency: jq (for metrics dashboard).
v1.3.4
GitHub Actions CI fix
v1.3.3
ShellCheck 100% clean
v1.3.2
Critical bug fixes: file order, lock security, completion detection
v1.3.1
- Added README.md for better documentation and onboarding. - Added demo-script.sh and install.sh example scripts. - Updated CHANGELOG.md and SKILL.md for the new version. - Improved emergency-recovery-monitor.sh and emergency-recovery.sh scripts.
v1.2.1
Add cleanup trap, log permissions, Linux systemd guide
v1.2.0
openclaw-self-healing 1.2.0 - Introduces a 4-tier autonomous self-healing architecture for OpenClaw Gateway. - Adds Claude Code as Level 3 emergency doctor for AI-powered diagnosis and repair. - Integrates Watchdog, Health Check (HTTP 200 with retries), Claude Recovery, and Discord Alert escalation. - Provides macOS LaunchAgent setup and step-by-step installation instructions. - All configuration is now handled via environment variables for easier setup and management.
Metadata
Slug openclaw-self-healing
Version 3.1.1
License
All-time Installs 16
Active Installs 15
Total Versions 10
Frequently Asked Questions

What is OpenClaw Self-Healing System?

4-tier autonomous self-healing and auto-recovery system for OpenClaw Gateway. Monitors gateway health, auto-restarts on crash, detects OAuth token expiry, ki... It is an AI Agent Skill for Claude Code / OpenClaw, with 4792 downloads so far.

How do I install OpenClaw Self-Healing System?

Run "/install openclaw-self-healing" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is OpenClaw Self-Healing System free?

Yes, OpenClaw Self-Healing System is completely free (open-source). You can download, install and use it at no cost.

Which platforms does OpenClaw Self-Healing System support?

OpenClaw Self-Healing System is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created OpenClaw Self-Healing System?

It is built and maintained by Ramsbaby (@ramsbaby); the current version is v3.1.1.

💬 Comments