← Back to Skills Marketplace
Session Cost
by
Kevin Haney
· GitHub ↗
· v1.0.4
· MIT-0
2159
Downloads
1
Stars
7
Active Installs
5
Versions
Install in OpenClaw
/install session-cost
Description
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...
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install session-cost - After installation, invoke the skill by name or use
/session-cost - Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Frequently Asked Questions
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 2159 downloads so far.
How do I install Session Cost?
Run "/install session-cost" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Session Cost free?
Yes, Session Cost is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Session Cost support?
Session Cost is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Session Cost?
It is built and maintained by Kevin Haney (@khaney64); the current version is v1.0.4.
More Skills