π¦ ClawHub
Agent Defibrillator
by @hazy2go
Watchdog that monitors your AI agent gateway and restarts it when it crashes. Triggers on "install defibrillator", "agent watchdog", "gateway monitor", "auto...
TERMINAL
clawhub install agent-defibrillatorπ About This Skill
name: agent-defibrillator description: Watchdog that monitors your AI agent gateway and restarts it when it crashes. Triggers on "install defibrillator", "agent watchdog", "gateway monitor", "auto-restart agent", or "keep agent alive". macOS launchd service with optional Discord notifications.
Agent Defibrillator
Watchdog service that monitors your AI agent gateway and restarts it when it crashes.
What It Does
Install
Recommended (review code first):
git clone https://github.com/hazy2go/agent-defibrillator.git
cd agent-defibrillator
./install.sh
Verify
launchctl list | grep defib
Configure
Edit ~/.openclaw/scripts/defibrillator.sh:
| Variable | Default | Description |
|----------|---------|-------------|
| DEFIB_GATEWAY_LABEL | ai.openclaw.gateway | launchd service label |
| DEFIB_RETRY_DELAY | 10 | Seconds between retries |
| DEFIB_MAX_RETRIES | 3 | Retries before restart |
| DEFIB_COOLDOWN | 300 | Seconds between restarts |
| DISCORD_CHANNEL | (empty) | Your channel ID for notifications |
Commands
# View logs
tail -f ~/.openclaw/logs/defibrillator.logManual check
~/.openclaw/scripts/defibrillator.shStop watchdog
launchctl bootout gui/$(id -u)/com.openclaw.defibrillatorRestart watchdog
launchctl kickstart -k gui/$(id -u)/com.openclaw.defibrillator
Uninstall
launchctl bootout gui/$(id -u)/com.openclaw.defibrillator
rm ~/Library/LaunchAgents/com.openclaw.defibrillator.plist
rm ~/.openclaw/scripts/defibrillator.sh