← 返回 Skills 市场
Session Cost
作者
Kevin Haney
· GitHub ↗
· v1.0.4
· MIT-0
2159
总下载
1
收藏
7
当前安装
5
版本数
在 OpenClaw 中安装
/install session-cost
功能描述
Analyze OpenClaw session logs to report token usage, costs, and performance metrics grouped by agent and model. Use when the user asks about API spending, to...
安全使用建议
This skill appears to do what it says: it reads OpenClaw session .jsonl logs (by default under ~/.openclaw/agents/) and computes token/cost summaries. It requires node to run. Before installing or running: (1) confirm you trust the machine-local .jsonl files being read (don't point --path at directories with unrelated sensitive data), (2) review the script if you want to be sure it won't be modified to exfiltrate data, and (3) run it locally (not on a multi-tenant system) if logs contain sensitive information. Note: the agent can invoke the skill autonomously (normal default), so if you enable autonomous behaviors be aware it may run the script without prompting.
功能分析
Type: OpenClaw Skill
Name: session-cost
Version: 1.0.4
The session-cost skill is a utility designed to analyze OpenClaw session logs for token usage and API spending. The implementation in scripts/session-cost.js uses standard Node.js file system modules to read and aggregate data from .jsonl files located in the user's ~/.openclaw/agents directory, which is consistent with its stated purpose. There are no signs of data exfiltration, malicious execution, or prompt injection attempts.
能力评估
Purpose & Capability
Name/description state: analyze OpenClaw session logs for token/cost metrics. The shipped script reads ~/.openclaw/agents/*/sessions/*.jsonl (or a user-specified path) and computes token/cost summaries. Required binary 'node' is appropriate and proportional.
Instruction Scope
SKILL.md and the script explicitly instruct the agent to read session .jsonl files and produce summaries. The behavior is narrowly scoped to reading session logs; options allow filtering by agent, provider, or directory. The skill does read arbitrary .jsonl files in any path you pass with --path, which is expected for this utility but means you should not point it at directories containing unrelated sensitive data.
Install Mechanism
There is no install spec; this is instruction-plus-script and requires an existing node binary. No remote downloads, package installs, or archive extraction are present.
Credentials
The skill declares no environment variables or credentials and the code does not access global env secrets. It only reads filesystem paths (defaulting to the user's home .openclaw agents folder). No requests for unrelated tokens/keys detected.
Persistence & Privilege
always is false and the skill does not modify other skills, agent configuration, or system-wide settings. The script is read-only (reads files) and does not persist privileged configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install session-cost - 安装完成后,直接呼叫该 Skill 的名称或使用
/session-cost触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
- Updated all example commands to use explicit absolute paths to the session-cost script.
- No changes to functionality or options; documentation change only.
v1.0.3
Session-cost 1.0.3 adds multi-agent support and more flexible filtering.
- Now scans and reports across all OpenClaw agents by default (not just `main`)
- Output grouped by agent and model, with grand totals per agent and overall
- New `--agent <name>` option to filter by agent
- Single-session lookup (`--details <id>`) searches all agents
- All output modes (text, table, JSON, Discord) updated for multi-agent awareness
- `--path` still supported to override agent discovery and analyze a specific directory
v1.0.2
- Documentation updated and improved in SKILL.md for clarity and completeness.
- No functional changes or new features; codebase remains unchanged.
v1.0.1
No user-facing changes in this version.
- Internal version bumped to 1.0.1.
- No file or documentation changes detected.
v1.0.0
Initial release of session-cost.
- Analyze OpenClaw session logs for token usage, API costs, and performance metrics grouped by model.
- Supports filtering by time offset, provider, session path, and detailed session breakdowns.
- Multiple output formats: text summary, compact table, JSON, and Discord/chat-friendly formatting.
- Provides session, token, cost, and cache statistics (both summary and per-session).
- Currently limited to the main agent sessions; future support for multi-agent selection planned.
元数据
常见问题
Session Cost 是什么?
Analyze OpenClaw session logs to report token usage, costs, and performance metrics grouped by agent and model. Use when the user asks about API spending, to... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2159 次。
如何安装 Session Cost?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install session-cost」即可一键安装,无需额外配置。
Session Cost 是免费的吗?
是的,Session Cost 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Session Cost 支持哪些平台?
Session Cost 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Session Cost?
由 Kevin Haney(@khaney64)开发并维护,当前版本 v1.0.4。
推荐 Skills