monitor

monitor is a command for coding agents from jianzhichun/emerge. It costs 0 tokens per session (889 once invoked), scanned A, original, MIT.

A command that creates a watcher for each configured remote runner. Each watcher observes runner events for patterns and follows a notification process when it finds one.

In plain words
What is it for?
It is for starting persistent per-runner monitoring agents and reporting pattern alerts through the defined popup process.
Why use it?
It lets operators monitor several runners without checking each one manually.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the emerge plugin — 15 skills, 10 commands, 3 agents, 24 hooks shipped together

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.

agentmods
npx agentmods add commands/jianzhichun/emerge/monitor
Clone the repo
git clone --depth 1 https://github.com/jianzhichun/emerge

Or install emerge, the plugin that ships this one along with the rest of its 15 skills, 10 commands, 3 agents, 24 hooks.

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 monitor

README.md
[![agentmods](https://agentmods.dev/badge/commands/jianzhichun/emerge/monitor.svg)](https://agentmods.dev/commands/jianzhichun/emerge/monitor)
Your own site
<a href="https://agentmods.dev/commands/jianzhichun/emerge/monitor"><img src="https://agentmods.dev/badge/commands/jianzhichun/emerge/monitor.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 889 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00889
Opus 5 $0.00000 $0.00445
Sonnet 5 $0.00000 $0.00178
Haiku 4.5 $0.00000 $0.00089

Measured 5d ago against content hash 15a243f2d947, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 5d ago.

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.

commands/monitor.md · 99 lines

How it starts

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

/emerge:monitor — Agents-Team Monitor Mode

Spawn a per-runner watcher agent for every configured runner. Each watcher monitors its runner's EventBus for patterns and applies the stage→action popup protocol autonomously.

Always invoke the admin CLI via the Emerge plugin root.

Steps

  1. Read configured runner profiles:

    python3 "${CLAUDE_PLUGIN_ROOT}/scripts/repl_admin.py" runner-status --pretty
    

    Extract the list of profile names (e.g. mycader-1, mycader-2). If no runners are configured, inform the user and stop.

  2. Create the monitor team:

    TeamCreate(team_name="emerge-monitors", description="Per-runner pattern watchers")
    
  3. Spawn one watcher per runner profile (replace {profile} for each):

    Agent(
        subagent_type="general-purpose",
        team_name="emerge-monitors",
        name="{profile}-watcher",
        prompt="""
    You are an emerge vertical monitor agent for runner: {profile}.
    
    Setup:
    1. Start Monitor:
       command: "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/watch_emerge.py --runner-profile {profile}"
       description: "pattern alert watcher — {profile}"
       persistent: true
    2. You are now idle, waiting for pattern alerts.
    
    On [OperatorMonitor] alert notification:
    - Read `stage` and `intent_signature` from the alert.
    - Apply the stage→action protocol:
      - stage=explore  → silent; record intent in notes if new
      - stage=canary   → call runner_notify MCP tool:
          runner_notify(
              runner_profile="{profile}",
              ui_spec={"type": "choice", "title": "emerge — 可以接管了",
                       "body": "[{intent_signature}] 已见 {occurrences} 次,接管?",
                       "options": ["接管", "跳过", "停止学习"],
                       "timeout_s": 15})
          接管 → icc_exec(intent_signature=<value from alert JSON field "intent_signature">)
         停止学习 → intent freeze via repl_admin intent-set --set frozen=true
      - stage=stable   → icc_exec(intent_signature=<value from alert JSON field "intent_signature">) silently
    
    AI uncertainty or knowledge distillation questions → call runner_notify with type=input:
      runner_notify(
          runner_profile="{profile}",
          ui_spec={"type": "input", "title": "emerge — 需要确认", "body": "<question>"})
      Store answer in NOTES.md via notes.comment cockpit action.
    
    - SendMessage(team_lead, summary of action taken)
    - Return to idle.
    
    On shutdown_request from team lead:
    - Stop your Monitor.
    - Exit cleanly.
    """
    )
    

    Repeat Agent spawn for each profile found in step 1.

Read the full file on GitHub · 99 lines

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. 5d ago First seen · 99 lines · 0 tokens per session scan A 15a243f2d947

Subscribe to this mod's changes

monitor is a command published in the GitHub repository jianzhichun/emerge (107 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 889 tokens. 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.