daemon.zh

daemon.zh is a command for coding agents from druide67/asiai. It costs 33 tokens per session (603 once invoked), scanned A, a copy of daemon.ja, Apache-2.0.

A macOS background service for running asiai's monitoring and web dashboard automatically when you log in.

In plain words
What is it for?
Use it to collect system and inference metrics at intervals, run the web dashboard continuously, view service status and logs, or stop the services.
Why use it?
It removes the need to start monitoring or the dashboard by hand and can restart the dashboard if it stops. It also keeps logs and can send webhook alerts when monitored conditions change.

Command

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/druide67/asiai/daemon.zh
Clone the repo
git clone --depth 1 https://github.com/druide67/asiai

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 daemon.zh

README.md
[![agentmods](https://agentmods.dev/badge/commands/druide67/asiai/daemon.zh.svg)](https://agentmods.dev/commands/druide67/asiai/daemon.zh)
Your own site
<a href="https://agentmods.dev/commands/druide67/asiai/daemon.zh"><img src="https://agentmods.dev/badge/commands/druide67/asiai/daemon.zh.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 603 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod 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.00033 $0.00603
Opus 5 $0.00016 $0.00302
Sonnet 5 $0.00007 $0.00121
Haiku 4.5 $0.00003 $0.00060

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

Security

Grade A, and why

daemon.zh 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.

Origin

This is a copy

91% identical to daemon.ja — 68 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

docs/commands/daemon.zh.md · 58 lines

What it actually says

asiai daemon

通过 macOS launchd LaunchAgent 管理后台服务。

服务

服务 描述 模式
monitor 定期采集系统 + 推理指标 周期性(StartInterval
web 作为持久服务运行 Web 仪表板 长驻(KeepAlive

用法

# 监控守护进程(默认)
asiai daemon start                     # 启动监控(每 60 秒)
asiai daemon start --interval 30       # 自定义间隔
asiai daemon start --alert-webhook URL # 启用 webhook 告警

# Web 仪表板服务
asiai daemon start web                 # 在 127.0.0.1:8899 启动 web
asiai daemon start web --port 9000     # 自定义端口
asiai daemon start web --host 0.0.0.0  # 暴露到网络(无认证!)

# 状态(显示所有服务)
asiai daemon status

# 停止
asiai daemon stop                      # 停止监控
asiai daemon stop web                  # 停止 web
asiai daemon stop --all                # 停止所有服务

# 日志
asiai daemon logs                      # 监控日志
asiai daemon logs web                  # Web 日志
asiai daemon logs web -n 100           # 最后 100 行

工作原理

每个服务在 ~/Library/LaunchAgents/ 安装单独的 launchd LaunchAgent plist:

  • Monitor:按配置间隔(默认 60 秒)运行 asiai monitor --quiet。数据存储在 SQLite 中。如提供 --alert-webhook,在状态转换(内存压力、温控、引擎下线)时通过 POST 发送告警。
  • Web:作为持久进程运行 asiai web --no-open。崩溃后自动重启(KeepAlive: trueThrottleInterval: 10s)。

两个服务都在登录时自动启动(RunAtLoad: true)。

安全性

  • 服务在用户级别运行(无需 root)
  • Web 仪表板默认绑定 127.0.0.1(仅本地)
  • 使用 --host 0.0.0.0 时显示警告——未配置认证
  • 日志存储在 ~/.local/share/asiai/
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 · 58 lines · 33 tokens per session scan A da35922a87d7

Subscribe to this mod's changes

daemon.zh is a command published in the GitHub repository druide67/asiai (11 stars, last pushed 6d ago), licensed Apache-2.0. It adds 33 tokens to every session and 603 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to daemon.ja, differing in 68 lines, and is treated as a copy.