LaunchKit · 2026
Back to Skills

session-cost

Analyze OpenClaw session logs to report token usage, costs, and performance metrics grouped by model.

1
1.7k downloads
by @khaney64

Setup & Installation

openclaw skills install @khaney64/session-cost

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install session-cost

Version History

v1.0.3Mar 4, 2026 - Version note by skill developer:

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

What This Skill Does

Reads OpenClaw session .jsonl log files and reports token usage, costs, and performance metrics grouped by agent and model. Supports filtering by agent name, provider, and time range. Output formats include plain text, JSON, compact table, and a Discord-friendly summary.

Aggregates costs and token counts across multiple agents and models in one command without needing to check each provider dashboard separately.

When to use it

  • Checking total API spend across all agents for the past week
  • Comparing token costs between Anthropic and OpenAI providers
  • Generating a daily usage digest formatted for a Discord bot
  • Auditing how much a specific agent consumed during a debugging session
  • Exporting session cost data as JSON for further processing

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: how much did I spend on Anthropic models in the last 24 hours?

AGENT
  1. 1Run `node scripts/session-cost.js --provider anthropic --offset 24h`
  2. 2Scan ~/.openclaw/agents/ for all agent directories
  3. 3Read .jsonl session files matching the time and provider filters
  4. 4Group results by agent and model, compute token and cost totals
OUTPUT

A breakdown of sessions, token counts, and dollar costs per agent and model for Anthropic usage in the past 24 hours