watchclaw

Auto-recovery watchdog for OpenClaw gateway. Monitors health, detects bad config changes, and recovers via git stash/revert. Supports native and Docker restart modes with pluggable alerts.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "watchclaw" with this command: npx skills add jarvis4wang/watchclaw

watchclaw

OpenClaw gateway watchdog — auto-recovery from bad config changes.

What It Does

watchclaw monitors your OpenClaw gateway and automatically recovers from bad configurations:

  • Health polling — checks gateway HTTP endpoint every N seconds
  • Config change detection — detects uncommitted or new commits in your config repo
  • Auto-recovery — stashes uncommitted changes (U1) or reverts bad commits (U2) via git
  • Probation — validates stability after config changes before promoting to known-good
  • Pluggable alerts — iMessage, webhook, or custom command on failure/recovery

Usage

# Start watching (background daemon)
watchclaw --config /path/to/watchclaw.conf start

# Start in foreground (for debugging)
watchclaw --config /path/to/watchclaw.conf start --foreground

# Check status
watchclaw --config /path/to/watchclaw.conf status

# Follow logs
watchclaw --config /path/to/watchclaw.conf logs -f

# Stop
watchclaw --config /path/to/watchclaw.conf stop

Config

Create a .conf file (see watchclaw.conf.example):

GATEWAY_PORT=18790
GATEWAY_CONFIG_DIR="$HOME/.openclaw"
POLL_INTERVAL_SEC=10
HEALTH_TIMEOUT_SEC=5
GATEWAY_TLS=0              # Use https for health check
MAX_RETRIES=3
ALERT_HOOK="imsg"           # imsg | webhook | command | none
ALERT_IMSG_TO="user@me.com"
RESTART_MODE="native"       # native | docker

Recovery Modes

ScenarioDetectionRecovery
Uncommitted config change breaks gatewayHealth check fails + dirty openclaw.jsongit stash → restart
Bad commit breaks gatewayHealth check fails + new commitgit revert → restart
Config change during healthy operationHEAD ≠ known-good in HEALTHY stateEnter probation, monitor

Docker Mode

For containerized OpenClaw (e.g., 飞书/Feishu bot):

RESTART_MODE="docker"
DOCKER_CONTAINER="openclaw-feishu"

Requirements

  • bash 4+, git, curl
  • OpenClaw gateway config must be in a git repo
  • python3 or node for JSON validation

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

qwencloud-model-selector

[QwenCloud] Recommend the best Qwen model and parameters. TRIGGER when: choosing between Qwen models, comparing Qwen model pricing, understanding Qwen model...

Registry SourceRecently Updated
General

deployment-manager

You are a deployment manager with expertise in release orchestration, deployment strategies, and production reliability. Use when: release orchestration and...

Registry SourceRecently Updated
General

Hk Stock Morning Report

Generate HK stock market morning report (股市晨報) for bank trading desks. Triggers: "生成晨报", "股市晨报", "今日股市", "港股晨報" 報告結構(5部分): 1. 市場回顧(恒指/科指/國指 + 強弱勢股) 2. 南下資金(總...

Registry SourceRecently Updated
General

Story Long Scan

长篇网文扫榜。分析起点、番茄、晋江等平台排行榜数据,提炼市场趋势与热门题材。 触发方式:/story-long-scan、/长篇扫榜、「长篇什么火」「起点排行」

Registry SourceRecently Updated