OpenClaw Guardian for Openclaw

A production-ready watchdog that monitors, repairs, and alerts for the OpenClaw gateway service to ensure high availability.

zurbrick
v1.0.0
Mar 6, 2026
0
799
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install gateway-sentinel

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 gateway-sentinel 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 OpenClaw Guardian?

OpenClaw Guardian is a specialized watchdog service designed to ensure the high availability of your OpenClaw gateway. It operates as a native background service on macOS and Linux, utilizing a multi-layered health check strategy to detect failures and trigger graduated repair sequences. By automating routine maintenance and emergency recoveries, it minimizes downtime for your AI agent infrastructure.

This tool is an essential addition to any production-grade deployment of Openclaw Skills, providing peace of mind through real-time notifications via Telegram or Discord. It goes beyond simple process monitoring by incorporating authoritative CLI status checks and HTTP fallbacks to confirm service health before taking corrective action.

OpenClaw Guardian Use Cases

  • Automating the recovery of the OpenClaw gateway after unexpected crashes or process hangs.
  • Receiving instant notifications on mobile devices via Telegram or Discord when service issues occur.
  • Maintaining a daily version-controlled history of your workspace through automated git snapshots.
  • Managing OpenClaw as a persistent system service on macOS or Linux environments for 24/7 reliability.
  • Preventing data loss during recovery attempts through safe git stashing before rollbacks.

How OpenClaw Guardian Works

  1. The service performs a graduated health check using the OpenClaw CLI followed by an HTTP fallback request to verify the gateway status.
  2. If both checks fail, the Guardian triggers an escalating repair sequence starting with a Level 1 service restart.
  3. If a restart fails to resolve the issue, it proceeds to Level 2 by executing a doctor fix command to repair the environment.
  4. For persistent failures, and only if explicitly enabled, it performs a Level 3 git rollback after safely stashing uncommitted work.
  5. Every significant action, from health check failures to successful repairs, is broadcast to configured alert channels and recorded in local logs.

OpenClaw Guardian Setup

To get started with this addition to your Openclaw Skills, first configure your environment variables in ~/.openclaw/guardian.env:

# Required for alerts - set at least one
export GUARDIAN_TELEGRAM_BOT_TOKEN="your_bot_token"
export GUARDIAN_TELEGRAM_CHAT_ID="your_chat_id"
# OR
export GUARDIAN_DISCORD_WEBHOOK_URL="your_webhook_url"

Then, run the installation script to set up the system service for your platform:

# Automatically detects macOS (launchd) or Linux (systemd)
./scripts/install-guardian.sh

Finally, verify the service is active:

# For macOS
launchctl list | grep openclaw

# For Linux
systemctl --user status openclaw-guardian

OpenClaw Guardian Data Schema & Taxonomy

The skill manages several runtime files and configuration structures to ensure operational integrity:

File Path Purpose
/tmp/openclaw-guardian.lock Single-instance lockfile containing the current PID.
/tmp/openclaw-guardian.log Active log file with automatic 1MB rotation and one backup file.
~/.openclaw/guardian.env Central configuration file for environment variables and credentials.
/tmp/openclaw-guardian-last-snapshot Tracks the date of the last successful daily workspace commit.

OpenClaw Guardian Advanced Features

  • Dual-channel alerting supporting Telegram and Discord simultaneously for redundant notifications.
  • Graduated repair logic with an optional, safe git rollback mechanism for deep recovery scenarios.
  • Automated daily workspace snapshots that respect your existing gitignore rules to secure your work.
  • Native system service integration providing robust lifecycle management via launchd and systemd.
  • Intelligent health monitoring using both CLI-level status signals and HTTP endpoint verification.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*