← 返回 Skills 市场
dagangtj

OC Cost Analyzer

作者 dagangtj · GitHub ↗ · v1.0.1
cross-platform ⚠ suspicious
376
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install oc-cost-analyzer
功能描述
分析 OpenClaw 的 token 使用和成本,识别高消耗场景(长对话、频繁 cron、大 context),给出具体优化建议(模型降级、context 压缩、cron 频率调整)。纯 Node.js,无外部依赖。输出清晰的成本报告。
安全使用建议
This skill is overall coherent with its stated purpose (local token/cost analysis) and does not call out to the network or require credentials, but there are documentation vs code mismatches you should address before running it. Actions to take before installing/running: 1) Inspect scripts/cost_analyzer.js yourself (it is included) to confirm it only reads the files you expect and only writes the report path. 2) Note the path mismatch: decide whether your session logs live in ~/.openclaw/agents/.../sessions or in ~/.openclaw/workspace/memory/conversations and update the script or docs accordingly. 3) Do NOT run any example shell delete commands until you back up those directories and understand the command. 4) Run the script in a limited environment (non-privileged account) first and review the generated report. 5) If you plan to automate via cron, double-check the full command and file paths to avoid accidental deletions or analyzing unrelated files. If you want higher assurance, ask the maintainer to fix the documentation inconsistency and to add a dry-run mode that emits which files would be analyzed before performing any writes.
功能分析
Type: OpenClaw Skill Name: oc-cost-analyzer Version: 1.0.1 The OpenClaw Cost Optimizer skill is benign. All files consistently declare strong security properties (no network, no subprocess, no external dependencies, local data only, read-only analysis except for report output), and the `scripts/cost_analyzer.js` code strictly adheres to these. It only reads OpenClaw session logs from `~/.openclaw/workspace/memory/conversations` and writes its analysis report to `~/.openclaw/workspace/memory/cost-analysis-report.md`. There is no evidence of data exfiltration, malicious execution, persistence, or prompt injection attempts against the agent. The recommended commands in SKILL.md are legitimate `openclaw` commands or standard system commands for maintenance, all within the skill's stated purpose.
能力评估
Purpose & Capability
The declared purpose — analyzing OpenClaw session logs and producing a local cost report — matches the included script's behavior. The script reads session-like JSON lines and computes token/cost stats and recommendations. However, the SKILL.md/README/SECURITY texts reference a different session path (~/.openclaw/agents/main/agent/sessions/*.jsonl) while the script's CONFIG.logsDir is ~/.openclaw/workspace/memory/conversations. This mismatch is likely an authoring/documentation error but could cause the tool to analyze the wrong files or miss logs.
Instruction Scope
Runtime instructions are straightforward (run node scripts/cost_analyzer.js analyze|quick) and otherwise local. But SKILL.md contains example shell commands that modify or delete files (e.g., find ~/.openclaw/workspace/memory -name "2026-*.md" -mtime +30 -delete) and other suggested commands (openclaw cron add/edit) that implicitly perform system changes if executed by the user. The script itself appears read-only except for writing the report; the documentation's 'no modifications' claim conflicts with suggested shell commands and with different log paths — this inconsistency broadens the agent's effective scope if a user follows the docs without review.
Install Mechanism
No install spec or network downloads. The skill is delivered as code files (pure Node.js) and expects node to run it. This is low-risk compared with remote installers.
Credentials
The skill requests no environment variables or credentials. It only accesses files under the user's home (reads logs, writes a report). No API keys or external services are required, which is proportionate for local cost analysis.
Persistence & Privilege
always is false and the script does not request elevated privileges. It writes output to ~/.openclaw/workspace/memory (report file) which is reasonable. There is no evidence the skill modifies other skills or global config. However the documentation suggests shell commands that can delete files — if users run those examples blindly they could cause data loss.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install oc-cost-analyzer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /oc-cost-analyzer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
v1.0.1: 修复日志路径,支持 OpenClaw 新版 session logs 格式
v1.0.0
初始版本
元数据
Slug oc-cost-analyzer
版本 1.0.1
许可证
累计安装 1
当前安装数 1
历史版本数 2
常见问题

OC Cost Analyzer 是什么?

分析 OpenClaw 的 token 使用和成本,识别高消耗场景(长对话、频繁 cron、大 context),给出具体优化建议(模型降级、context 压缩、cron 频率调整)。纯 Node.js,无外部依赖。输出清晰的成本报告。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 376 次。

如何安装 OC Cost Analyzer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install oc-cost-analyzer」即可一键安装,无需额外配置。

OC Cost Analyzer 是免费的吗?

是的,OC Cost Analyzer 完全免费(开源免费),可自由下载、安装和使用。

OC Cost Analyzer 支持哪些平台?

OC Cost Analyzer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 OC Cost Analyzer?

由 dagangtj(@dagangtj)开发并维护,当前版本 v1.0.1。

💬 留言讨论