activity-monitor

activity-monitor is a skill for Claude Code from zylos-ai/zylos-core. It costs 36 tokens per session (2,626 once invoked), scanned A, original, MIT.

A background guardian service that watches whether a running coding agent is responsive and restarts it when it stops or crashes.

In plain words
What is it for?
Use it to track agent activity, record health status, send heartbeat checks, and trigger automatic restarts.
Why use it?
It reduces manual recovery when the agent becomes unresponsive or the process fails.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to track agent activity, record health status, send heartbeat checks, and trigger automatic restarts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zylos-ai/zylos-core/activity-monitor
About the project

Zylos is open-source infrastructure that gives an AI agent persistent memory, scheduled activity, communication channels, and the ability to maintain and extend itself. Individuals and teams use it with Claude Code or Codex through Telegram, Lark, or a web console. Its catalogue add-ons define settings, instructions, and skills for operating the agent.

zylos-ai/zylos-core · 1,151 stars · on GitHub · zylos.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zylos-ai/zylos-core --skill activity-monitor
Clone the repo
git clone --depth 1 https://github.com/zylos-ai/zylos-core

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for activity-monitor

README.md
[![agentmods](https://agentmods.dev/badge/skills/zylos-ai/zylos-core/activity-monitor/github.svg)](https://agentmods.dev/skills/zylos-ai/zylos-core/activity-monitor)
Your own site
<a href="https://agentmods.dev/skills/zylos-ai/zylos-core/activity-monitor"><img src="https://agentmods.dev/badge/skills/zylos-ai/zylos-core/activity-monitor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for activity-monitor

Your own site · 80×15
<a href="https://agentmods.dev/skills/zylos-ai/zylos-core/activity-monitor"><img src="https://agentmods.dev/badge/skills/zylos-ai/zylos-core/activity-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,626 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 8 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 197
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 199
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 207
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 214
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 217
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 220
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 208
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 213
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.02626
Opus 5 $0.00018 $0.01313
Sonnet 5 $0.00007 $0.00525
Haiku 4.5 $0.00004 $0.00263

Measured 13d ago against content hash a931d5610668, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

activity-monitor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

The scan reads SKILL.md. This mod also ships 58 executable files (scripts/__tests__/claude-pid.test.js, scripts/__tests__/emit-custom-inject.test.js, scripts/__tests__/guardian.test.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/activity-monitor/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Activity Monitor Skill

PM2 guardian service that monitors the active runtime agent's (Claude or Codex) activity state and ensures it's always running.

When to Use

This is a PM2 service (not directly invoked by Claude). It runs continuously in the background.

What It Does

  1. Activity Monitoring: Tracks the agent's busy/idle state every second
  2. Status File: Writes ~/zylos/activity-monitor/agent-status.json with current state (busy/idle, idle_seconds, health)
  3. Guardian Mode: Automatically restarts the agent if it stops or crashes
  4. Maintenance Awareness: Waits for restart/upgrade scripts to complete before starting the agent
  5. Heartbeat Liveness Detection: Periodically sends heartbeat probes via the C4 control queue to verify the agent is responsive, triggering recovery when probes fail
  6. Health Check: Periodically enqueues system health checks (PM2, disk, memory) via the C4 control queue
  7. Daily Upgrade: Enqueues a Claude Code upgrade via the C4 control queue at 5:00 AM local time daily (disabled by default; enable with zylos config set daily_upgrade_enabled true)
  8. Context Monitoring: Receives context usage data after every turn; triggers early memory sync and new-session handoff at thresholds read from config.json (new_session_threshold for Claude, codex_new_session_threshold for Codex), each with a built-in runtime fallback if the key is unset

Status File Format

{
  "state": "idle",
  "last_activity": 1738675200,
  "last_check": 1738675210,
  "last_check_human": "2026-02-04 20:30:10",
  "idle_seconds": 5,
  "inactive_seconds": 10,
  "source": "conv_file",
  "health": "ok"
}
  • state: "busy" | "idle" | "stopped" | "offline"
  • idle_seconds: Time since entering idle state (0 when busy)
  • source: "conv_file" (reliable) | "tmux_activity" (fallback)
  • health: "ok" | "recovering" | "down" — liveness health from the heartbeat engine

PM2 Management

# Start
pm2 start ~/zylos/.claude/skills/activity-monitor/scripts/activity-monitor.js --name activity-monitor

# Restart
pm2 restart activity-monitor

# View logs
pm2 logs activity-monitor

# Check status
pm2 list

Read the full file on GitHub · 227 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 227 lines · 36 tokens per session scan A a931d5610668

Subscribe to this mod's changes

activity-monitor is a skill published in the GitHub repository zylos-ai/zylos-core (1,151 stars, last pushed 3d ago), licensed MIT. It adds 36 tokens to every session and 2,626 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.