← 返回 Skills 市场
370
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install openclaw-cost-analyzer
功能描述
分析 OpenClaw 的 token 使用和成本,识别高消耗场景(长对话、频繁 cron、大 context),给出具体优化建议(模型降级、context 压缩、cron 频率调整)。纯 Node.js,无外部依赖。输出清晰的成本报告。
安全使用建议
This skill appears to be a local cost-analysis tool and does not contain network calls, external installs, or credential requests — but review before use:
- Verify which session-log path your OpenClaw actually uses. The documentation claims ~/.openclaw/agents/main/agent/sessions/*.jsonl, but the script reads ~/.openclaw/workspace/memory/conversations. If these don't match, the script will find no logs. Update CONFIG.logsDir in scripts/cost_analyzer.js or adjust where your logs are stored.
- Inspect the full script yourself (scripts/cost_analyzer.js) and run it in a non-production environment first. It appears to only use fs/path/os, but confirm there are truly no network calls in the rest of the file (the provided snippet is truncated).
- Be cautious when copying suggested shell commands from SKILL.md (e.g., find ... -delete or cron add entries). Those are manual operations and can delete files or schedule jobs if executed.
- Note incomplete behavior: cron detection is unimplemented (session.isCron is hardcoded false), and some cost/threshold heuristics (modelCosts values and savings math) look approximate — validate the pricing data for your models before acting on savings recommendations.
- If you plan to automate daily/weekly runs, ensure the script is placed where SKILL.md assumes (or update the cron commands) and consider running it under a user with limited permissions. If you want higher assurance, run the script on a copy of your logs and confirm outputs before making configuration changes.
If you want, I can: (1) point out the exact lines in scripts/cost_analyzer.js to change to match your real log location, (2) search the full file for any network/subprocess patterns, or (3) suggest a small dry-run mode to print filenames found without writing reports.
功能分析
Type: OpenClaw Skill
Name: openclaw-cost-analyzer
Version: 1.0.0
The OpenClaw Cost Optimizer skill is benign. The `scripts/cost_analyzer.js` script strictly adheres to its stated purpose of analyzing OpenClaw token usage and costs. It only reads session logs from `~/.openclaw/workspace/memory/conversations` and writes a report to `~/.openclaw/workspace/memory/cost-analysis-report.md`. Crucially, the code contains no network requests, subprocess execution, dynamic code evaluation, or attempts to access sensitive files outside its scope, verifying the strong security claims made in `SKILL.md`, `package.json`, `README.md`, and `SECURITY.md`. There are no signs of prompt injection in `SKILL.md` attempting to subvert the agent's core directives; all instructions are aligned with the skill's stated function.
能力评估
Purpose & Capability
The name/description (cost analysis & optimization) matches the provided script: the Node.js script reads local logs, computes token/cost stats, and writes a report. No unrelated credentials or network access are requested. However, the SKILL.md and Security.md claim a different session-log path (~/.openclaw/agents/main/agent/sessions/*.jsonl) while the script's CONFIG.logsDir points to ~/.openclaw/workspace/memory/conversations — this mismatch will likely make the tool miss real logs unless paths are reconciled.
Instruction Scope
SKILL.md instructs reading session logs and only local operations, which the script follows, but there are several scope issues: the logs path in docs differs from the script's path; the script marks cron detection as TODO (session.isCron stays false), so cron analysis is incomplete; SKILL.md suggests shell commands (find -delete) and other openclaw/ollama CLI commands as manual actions — those are user actions but could be destructive if copy-pasted without caution. The instructions also reference other skills (openclaw-token-optimizer) without guaranteeing their presence.
Install Mechanism
No install spec; this is effectively an instruction-only skill with a script file. That minimizes installer risk. The script uses only Node built-ins (fs, path, os) and there's no install-step downloading external code.
Credentials
No environment variables, no credentials, and no external endpoints are requested. The script only reads local files and writes a report to the user's workspace directory.
Persistence & Privilege
always:false and no attempt to modify other skills or global config. The script writes a report into the user's memory workspace only. It does not persist credentials or alter agent configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install openclaw-cost-analyzer - 安装完成后,直接呼叫该 Skill 的名称或使用
/openclaw-cost-analyzer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
初始版本:完整成本分析、高消耗场景识别、优化建议生成
元数据
常见问题
OpenClaw Cost Analyzer 是什么?
分析 OpenClaw 的 token 使用和成本,识别高消耗场景(长对话、频繁 cron、大 context),给出具体优化建议(模型降级、context 压缩、cron 频率调整)。纯 Node.js,无外部依赖。输出清晰的成本报告。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 370 次。
如何安装 OpenClaw Cost Analyzer?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install openclaw-cost-analyzer」即可一键安装,无需额外配置。
OpenClaw Cost Analyzer 是免费的吗?
是的,OpenClaw Cost Analyzer 完全免费(开源免费),可自由下载、安装和使用。
OpenClaw Cost Analyzer 支持哪些平台?
OpenClaw Cost Analyzer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenClaw Cost Analyzer?
由 dagangtj(@dagangtj)开发并维护,当前版本 v1.0.0。
推荐 Skills