Skip to content
Back to skills

Monitor Claude

ASecurity

Continuous Claude Code process health monitor. Detects memory-leaked sessions, zombie headless agents, and runaway CPU usage. Fires Discord alerts and optionally auto-kills processes exceeding hard limits. Designed to run on a scheduler.

  • 6 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
businessbash

Works with

  • claude code

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add grahama1970/agent-skills --skill monitor-claude --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Monitor Claude?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Monitor Claude
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/grahama1970-monitor-claude/badge)](https://www.skillsdirectory.com/skills/grahama1970-monitor-claude)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: monitor-claude
description: >
  Continuous Claude Code process health monitor. Detects memory-leaked sessions,
  zombie headless agents, and runaway CPU usage. Fires Discord alerts and optionally
  auto-kills processes exceeding hard limits. Designed to run on a scheduler.
triggers:
  - monitor claude processes
  - check claude memory usage
  - find zombie claude sessions
  - claude process health
  - are any claude sessions leaking memory
  - how many claude processes are running
  - kill stale claude processes
allowed-tools:
  - Bash
  - Read
metadata:
  short-description: Continuous Claude Code process health watchdog
provides:
  - claude-process-monitoring
  - claude-memory-watchdog
  - claude-zombie-detection
composes:
  - ops-claude
  - memory
  - scheduler
  - agentic-evals
taxonomy:
  - monitoring
  - operations
disciplines:
  - observability-operations
---

> STOP. READ THIS ENTIRE SKILL.MD BEFORE CALLING ANY ENDPOINT.

# monitor-claude

Continuous health watchdog for Claude Code processes. Detects and alerts on:

- **Memory leaks**: Processes with RSS exceeding configurable threshold (default 5 GB)
- **Zombie agents**: Headless processes (no TTY) older than max age (default 4 hours)
- **CPU runaways**: Processes consuming >80% CPU for extended periods
- **Process sprawl**: Total Claude process count exceeding limit (default 15)

## Commands

| Command | Description |
|---------|-------------|
| `scan` | One-shot scan, report findings to stdout |
| `scan --kill` | Scan and auto-kill processes exceeding hard limits |
| `scan --json` | Machine-readable JSON output |
| `watch` | Continuous mode — scan every interval, alert on violations |
| `status` | Quick summary: process count, total RSS, top offenders |
| `history` | Show recent alert history from log |

## Thresholds (configurable via env vars)

| Variable | Default | Description |
|----------|---------|-------------|
| `CLAUDE_MAX_RSS_GB` | 5 | Soft alert threshold per process (GB) |
| `CLAUDE_HARD_RSS_GB` | 15 | Hard kill threshold per process (GB) |
| `CLAUDE_MAX_HEADLESS_HOURS` | 4 | Max age for headless processes (hours) |
| `CLAUDE_MAX_PROCESSES` | 15 | Alert when total count exceeds this |
| `CLAUDE_SCAN_INTERVAL` | 300 | Seconds between scans in watch mode |

## Examples

```bash
# Quick check
/monitor-claude status

# Full scan with findings
/monitor-claude scan

# Auto-kill leakers and zombies
/monitor-claude scan --kill

# Continuous daemon mode (for scheduler)
/monitor-claude watch
```

## Scheduler Integration

Register with `/scheduler` for nightly runs:
```bash
/scheduler register monitor-claude --cron "*/30 * * * *" --cmd "scan --kill"
```

Files in this skill

  • SKILL.md2.6 KB
  • fixtures/agentic_eval.json492 B
  • monitor.py20.6 KB
  • pyproject.toml275 B
  • run.sh441 B
  • sanity.sh1 KB
  • uv.lock14.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.