← Back to Skills Marketplace
Model Usage Monitor
by
halfmoon82
· GitHub ↗
· v1.0.1
· MIT-0
388
Downloads
1
Stars
2
Active Installs
2
Versions
Install in OpenClaw
/install model-usage-monitor
Description
监控并统计模型调用次数和成本,计算缓存命中率,支持实时监控与每小时自动告警。
Usage Guidance
This skill largely does local, read-only log analysis as advertised, but two things to watch: (1) monitor.py reads session JSONL files under ~/.openclaw/agents/main/sessions — those files can contain conversation text and metadata; the SKILL.md did not disclose this access. If you have sensitive conversations stored, review the code and consider restricting or removing session access. (2) setup.py invokes the 'openclaw' CLI to create a cron job; confirm you trust that CLI and understand whether it contacts any external service. Before installing: inspect monitor.py (you have full source), run the script manually in a safe environment to see what it reads, and if you prefer, disable automatic cron creation (do not run setup.py) and instead run the script manually or create a cron job yourself after review. If you need higher assurance, run the install in an isolated test environment first.
Capability Analysis
Type: OpenClaw Skill
Name: model-usage-monitor
Version: 1.0.1
The skill is a local model usage and cost monitoring tool that parses OpenClaw log files (`gateway.log`, `semantic_check.log`) and session metadata to estimate token costs and cache hit rates. The installation process via `install.sh` and `setup.py` is transparent, using the `openclaw` CLI to schedule a local cron job for hourly alerts. The core logic in `monitor.py` contains no network calls, no obfuscation, and no evidence of data exfiltration, performing all analysis locally on the user's machine.
Capability Assessment
Purpose & Capability
The stated purpose (monitor model usage, estimate cost, compute cache hit rate, hourly alerts) matches the code's functionality: parsing semantic and gateway logs and estimating costs. However, the code also parses agent session files (~/.openclaw/agents/main/sessions/*.jsonl) to extract per-session message/model details — this session-level access is not described in the SKILL.md security table and expands scope beyond the explicit declarations.
Instruction Scope
SKILL.md claims only read-only access to semantic_check.log and OpenClaw gateway logs and that nothing sensitive is accessed. The shipped monitor.py does read those logs, but also reads session JSONL files and extracts 'message' contents (assistant messages) and metadata.model. Session files can contain conversation contents and personally sensitive data; that access is not documented in the permission table. Additionally, installation/setup uses the 'openclaw' CLI to create a cron job — the SKILL.md asserts no external APIs but the openclaw CLI could interact with local or remote services depending on implementation; this is not documented.
Install Mechanism
There is no remote download; install.sh and setup.py perform local file copies and directory creation only. install.sh is transparent and copies monitor.py into the user's ~/.openclaw workspace; setup.py similarly writes the script and attempts to create a cron job via the openclaw CLI. No external URL downloads or archive extraction are present in the provided files.
Credentials
The skill does not request environment variables or external credentials, which is appropriate. One omission: setup.py and the SKILL.md rely on the presence of the 'openclaw' CLI (used to list/create cron jobs) but that binary is not declared in the required-binaries list. If present, that CLI will be invoked and its privileges/behavior should be reviewed.
Persistence & Privilege
The skill sets up a persistent scheduled check (Cron job) via the openclaw CLI. Persistent scheduled execution is expected for monitoring, but because the cron runs the monitor script regularly and the script reads session files (sensitive data), this increases the long-term exposure surface. The skill is not force-included (always:false), but it does attempt to create persistent execution during install.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install model-usage-monitor - After installation, invoke the skill by name or use
/model-usage-monitor - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Version 1.0.1 of model-usage-monitor
- Added detailed security & permissions declaration to documentation, clarifying all operations are read-only except notifications.
- Introduced new files, including setup and library modules, for improved installation and modular monitoring logic.
- Updated documentation structure, including new README files in both English and Chinese.
- Refined file organization with dedicated config and script directories.
- No changes to monitoring logic or user-facing features.
v1.0.0
初版:支持模型调用分布统计、成本估算、缓存命中率分析、每小时自动告警
Metadata
Frequently Asked Questions
What is Model Usage Monitor?
监控并统计模型调用次数和成本,计算缓存命中率,支持实时监控与每小时自动告警。 It is an AI Agent Skill for Claude Code / OpenClaw, with 388 downloads so far.
How do I install Model Usage Monitor?
Run "/install model-usage-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Model Usage Monitor free?
Yes, Model Usage Monitor is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Model Usage Monitor support?
Model Usage Monitor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Model Usage Monitor?
It is built and maintained by halfmoon82 (@halfmoon82); the current version is v1.0.1.
More Skills