An open API service indexing awesome lists of open source software.

https://github.com/GENWAY-AI/clawatch

Open source observability for OpenClaw agents. Real-time monitoring, cost tracking & management, and smart alerts. Free forever.
https://github.com/GENWAY-AI/clawatch

ai-agents cost-management cost-optimization nanoclaw observability openclaw

Last synced: about 2 months ago
JSON representation

Open source observability for OpenClaw agents. Real-time monitoring, cost tracking & management, and smart alerts. Free forever.

Awesome Lists containing this project

README

          


ClaWatch

# ClaWatch

### **Monitor, control, and auto-fix your AI agents.**

*Open source observability for OpenClaw agents โ€” real-time observability, cost guardrails, and autonomous issue resolution*

[![npm version](https://img.shields.io/npm/v/clawatch.svg?style=flat&color=00C853)](https://www.npmjs.com/package/clawatch)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)

[**๐Ÿš€ Live Demo**](https://clawatch.dev/dashboard) ยท [**๐Ÿ“ฆ npm**](https://www.npmjs.com/package/clawatch) ยท [**โญ Star on GitHub**](https://github.com/GENWAY-AI/clawatch)

---

## Why ClaWatch?

Your AI agents spawn sub-agents, burn tokens, call tools, and sometimes get stuck in loops or blow through API credits. **ClaWatch doesn't just show you what's happening โ€” it steps in.** Set cost thresholds that auto-pause runaway agents. Get intelligent alerts that explain *why* something broke. Let the auto-fixer resolve common failures before you even wake up.

Visibility is table stakes. ClaWatch gives you **control and autonomy** โ€” so your agents run reliably while you sleep.

Built for teams shipping AI products. Open source. Free forever.

---

## โœจ Features

### ๐Ÿ›ก๏ธ **Cost Guardrails & Auto-Pause**
Set daily or monthly spend limits per agent. When a threshold is hit, ClaWatch auto-pauses the agent before it drains your credits โ€” no human in the loop required.

### ๐Ÿ”ง **Autonomous Issue Resolution**
Stuck in a loop? Crashed mid-task? ClaWatch detects common failure patterns and auto-resolves them โ€” restart agents, kill runaway sessions, and recover gracefully.

### โฏ๏ธ **Control Agents from Anywhere**
Pause, resume, or stop agents directly from the dashboard or your phone. One click, instant effect โ€” even at 3 AM from your bed.

### ๐Ÿšจ **Smart Alerts That Explain Why**
Not just "agent crashed." ClaWatch tells you *what* failed, *why* it happened, and *what it did about it*. Telegram, Slack, or webhook โ€” your choice.

### ๐Ÿ“Š **Unified Session View**
Group sessions into projects for a bird's-eye view. See cost, timeline, and agent breakdown across related work. Interactive charts with zoom.

### ๐ŸŒ **Multi-Profile Support**
Monitor multiple OpenClaw installations from one dashboard. Switch profiles instantly โ€” dev, staging, production.

---

## ๐Ÿš€ Quick Start

### Install

```bash
npm install -g clawatch
```

### Start Monitoring

```bash
clawatch start
```

That's it! ClaWatch auto-detects your OpenClaw agents and opens the dashboard at `http://localhost:3001`.

### Add Alerts (Optional)

```bash
# Get Telegram notifications when agents misbehave
export TELEGRAM_BOT_TOKEN="your_bot_token"
export TELEGRAM_CHAT_ID="your_chat_id"

clawatch start
```

---

## ๐Ÿ› ๏ธ CLI Commands

| Command | Description |
|---------|-------------|
| `clawatch start` | Auto-detect agents, start monitoring, and open the dashboard |
| `clawatch stop` | Stop the monitoring daemon gracefully |
| `clawatch status` | Show active agents, sessions, and daemon health |
| `clawatch logs` | Stream real-time logs from the monitoring daemon |

---

## ๐Ÿ—๏ธ How It Works

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ OpenClaw Agents โ”‚ (~/.openclaw/*)
โ”‚ Sessions, Logs โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ClaWatch CLI โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ Backend API โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ Alert Channels โ”‚
โ”‚ (Daemon) โ”‚ โ”‚ Express+SQLite โ”‚ โ”‚ Telegram/Slack โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Web Dashboard โ”‚
โ”‚ (Next.js) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
http://localhost:3001
```

1. **CLI daemon** watches `~/.openclaw/` for agent activity
2. **Backend API** aggregates data into SQLite
3. **Dashboard** visualizes everything in real-time
4. **Alert system** watches for anomalies and notifies you

---

## ๐Ÿฆž Works with Your Stack

ClaWatch auto-detects your agent framework. Full support today, more coming soon.

| Framework | Status |
|-----------|--------|
| [๐Ÿฆž OpenClaw](https://openclaw.ai) | โœ… Fully supported |
| [NanoClaw](https://nanoclaw.net) | โœ… Fully supported |
| [ZeroClaw](https://zeroclaw.dev) | ๐Ÿ”œ Coming soon |
| [TrustClaw](https://www.trustclaw.app) | ๐Ÿ”œ Coming soon |
| [Nanobot](https://nanobot.ai) | ๐Ÿ”œ Coming soon |
| [PicoClaw](https://picoclaw.dev) | ๐Ÿ”œ Coming soon |

Want support for your framework? [Request it โ†’](https://github.com/GENWAY-AI/clawatch/issues)

---

## ๐Ÿ”” Alert Channels

Get notified where your team already works.

| Channel | Status | Setup Guide |
|---------|--------|-------------|
| ๐Ÿ“ฑ **Telegram** | โœ… Live | [Setup docs](https://github.com/GENWAY-AI/clawatch#add-alerts-optional) |
| ๐Ÿ’ฌ **Slack** | ๐Ÿ”œ Soon | Coming soon |
| ๐ŸŽฎ **Discord** | ๐Ÿ”œ Soon | Coming soon |
| ๐Ÿ“ง **Email** | ๐Ÿ”œ Soon | Coming soon |
| ๐Ÿ“Ÿ **PagerDuty** | ๐Ÿ”œ Soon | Coming soon |

### Alert Types

- ๐Ÿ”ด **Agent Crash** โ€” Agent stopped unexpectedly
- ๐Ÿ” **Infinite Loop** โ€” Agent stuck repeating the same action
- ๐Ÿ’ธ **Cost Spike** โ€” Agent exceeded hourly/daily budget
- ๐Ÿ• **Agent Stalled** โ€” No activity for >10 minutes
- โš ๏ธ **High Error Rate** โ€” Multiple tool call failures

---

## ๐Ÿณ Self-Host with Docker

Want to run ClaWatch on a remote server? Use Docker:

```bash
git clone https://github.com/GENWAY-AI/clawatch.git
cd clawatch
docker build -t clawatch .
docker run -p 3001:3001 -e TELEGRAM_BOT_TOKEN=xxx clawatch
```

Supports any platform with Docker: **AWS, GCP, Azure, Hetzner, Digital Ocean, Render, Fly.io**.

---

## ๐Ÿ’ป Runs Where You Run

If OpenClaw runs there, ClaWatch runs there.

- โœ… macOS (Apple Silicon & Intel)
- โœ… Linux (Ubuntu/Debian)
- โœ… Windows WSL
- โœ… Raspberry Pi
- โœ… AWS / GCP / Digital Ocean / Hetzner

---

## ๐Ÿง‘โ€๐Ÿ’ป Development

### Prerequisites

- Node.js 18+
- npm or pnpm

### Local Setup

```bash
# Clone the repo
git clone https://github.com/GENWAY-AI/clawatch.git
cd clawatch

# Backend
cd backend
npm install
npm run dev # http://localhost:3001/api

# Frontend (new terminal)
cd frontend
npm install
npm run dev # http://localhost:3000

# CLI (new terminal)
cd cli
npm install
npm run build
npm link # Makes `clawatch` command available
```

### Project Structure

```
clawatch/
โ”œโ”€โ”€ cli/ # Monitoring daemon + CLI
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ cli.ts # Main entry point
โ”‚ โ”‚ โ””โ”€โ”€ daemon.ts # Background monitoring
โ”‚ โ””โ”€โ”€ package.json
โ”œโ”€โ”€ backend/ # Express API
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ index.ts # Server
โ”‚ โ”‚ โ”œโ”€โ”€ routes/ # REST endpoints
โ”‚ โ”‚ โ””โ”€โ”€ db.ts # SQLite schema
โ”‚ โ””โ”€โ”€ package.json
โ”œโ”€โ”€ frontend/ # Next.js dashboard
โ”‚ โ”œโ”€โ”€ app/ # Pages
โ”‚ โ”œโ”€โ”€ components/ # React components
โ”‚ โ””โ”€โ”€ package.json
โ”œโ”€โ”€ Dockerfile # Production container
โ””โ”€โ”€ API_CONTRACT.md # Backend API docs
```

---

## ๐Ÿ“ˆ Roadmap

### โœ… Shipped

- [x] Real-time agent monitoring
- [x] Cost tracking (per agent, per model)
- [x] Telegram alerts
- [x] Multi-profile support
- [x] Session logs & project grouping
- [x] Agent control (pause/resume)
- [x] Docker support for self-hosting
- [x] Pure WASM SQLite (no native deps)
- [x] Interactive analytics with chart zoom & URL persistence

### ๐Ÿšง In Progress

- [ ] Agent Auto-Fixer (autonomous failure detection & recovery)
- [ ] Slack integration
- [ ] Discord bot
- [ ] Custom alert rules builder

### ๐Ÿ”ฎ Coming Soon

- [ ] NanoClaw/ZeroClaw/TrustClaw support
- [ ] Multi-user auth & teams
- [ ] Agent performance scoring
- [ ] Cost prediction
- [ ] Webhook alerts
- [ ] Email alerts

[**Vote on features โ†’**](https://github.com/GENWAY-AI/clawatch/discussions)

---

## ๐Ÿค Contributing

We love contributions! Bug reports, feature requests, and PRs are all welcome.

### How to Contribute

1. **Fork the repo** and create a feature branch
2. **Make your changes** (add tests if applicable)
3. **Open a PR** with a clear description
4. **We'll review** and merge within 48 hours

### Good First Issues

Check out issues labeled [`good first issue`](https://github.com/GENWAY-AI/clawatch/labels/good%20first%20issue).

---

## ๐Ÿ’ฌ Community & Support

- **GitHub Discussions**: [Ask questions, share tips](https://github.com/GENWAY-AI/clawatch/discussions)
- **GitHub Issues**: [Report bugs, request features](https://github.com/GENWAY-AI/clawatch/issues)
- **Discord**: [Join our community](https://discord.gg/A7mYjwja)
- **Email**: hello@genway.ai

---

## ๐Ÿ“œ License

MIT ยฉ [GENWAY AI](https://github.com/GENWAY-AI)

Free to use in commercial products. See [LICENSE](./LICENSE) for details.

---



### **Built with โค๏ธ by [GENWAY AI](https://genway.ai)**

[Website](https://clawatch.dev) ยท [GitHub](https://github.com/GENWAY-AI/clawatch) ยท [npm](https://www.npmjs.com/package/clawatch)