Skip to main content

Healthcheck

Keeps your AI running smoothly. Watches for problems, fixes what it can, and alerts you about the rest. Includes a daily backup system with verification. Zero npm dependencies. Runs via macOS LaunchAgent.

What It Does

Runs every 3 minutes and checks:
  1. Gateway process … is your AI’s gateway running?
  2. HTTP probe … does the gateway respond to requests?
  3. File descriptors … is the gateway approaching system limits?
  4. Token usage … are any sessions near context window capacity?
  5. Memory health (every 5th run) … NULL embedding vectors, API key errors, session export freshness, memory capture errors
When something fails:
  • Auto-restart: Restarts the gateway automatically (rate-limited so it doesn’t loop)
  • AI alert: Sends a message to your AI via the chat endpoint
  • iMessage fallback: Direct iMessage to you if the AI is unreachable

Install

This installs a LaunchAgent that runs the healthcheck every 3 minutes.

Backup system (optional)

This installs:
  • A LaunchAgent that runs daily backups at midnight
  • A scheduled job that verifies the backup at 00:30

Configuration

Copy config.example.json to config.json and edit:

Key Fields

Backup Sources

Add custom backup sources to backup.sources:
Types: file (copy), tar (archive directory), dir (recursive copy). If sources is empty, the backup script backs up core files automatically (crystal.db, context-embeddings.sqlite, main.sqlite, workspace, sessions, config).

Manual Run

Uninstall

Files

Requirements

  • Node.js (18+)
  • macOS (uses LaunchAgent, iMessage, lsof)
  • OpenClaw gateway running

License

MIT