token-stats

Parse JSONL session logs to collect and report token usage.

Updated Feb 1, 2026
One-click install
npx skills add https://github.com/ShenWang96/clawdbot_workspace_backup --skill token-stats-shenwang96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-stats
Source: https://github.com/ShenWang96/clawdbot_workspace_backup/tree/main/skills/token-stats
Command: npx skills add https://github.com/ShenWang96/clawdbot_workspace_backup --skill token-stats-shenwang96

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Token usage data is scattered across session logs and hard to aggregate, making cost tracking and model usage analysis slow and error-prone. This Skill automates the collection and consolidation of token usage data into a centralized log with incremental updates.

Core Features & Use Cases

  • Automatic scanning: periodically parse session logs to extract token usage data.
  • Incremental updates: only process entries added since the last scan.
  • Reporting: generate date- and model-based statistics, costs, and usage trends.
  • Use Case: monitor API costs and optimize spending across models for a growing team.

Quick Start

请运行 token-stats-now,以扫描会话日志并生成最新的统计报告。

Frequently Asked Questions about token-stats

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate token usage extraction from session logs?

You can automate token usage extraction by parsing JSONL session logs incrementally, which scans only new entries since the last run to consolidate usage data and generate cost analysis reports.

Can I track API costs per model and per date from session logs?

Yes, you can track API costs by parsing session logs to generate per-date and per-model token breakdowns, providing a centralized view of usage trends and spending across different models.

How does incremental scanning work for session log token analysis?

Incremental scanning uses a tracker-based deduplication mechanism to parse only newly added JSONL session log entries since the previous scan, preventing redundant processing and keeping aggregated statistics up to date.

What is the best way to aggregate scattered token data for cost tracking?

The best way to aggregate scattered token data is to use a lightweight CLI that automatically parses session logs, deduplicates entries, and exports a centralized summary of usage trends and costs.

Does token-stats require any external dependencies to parse JSONL logs?

No external dependencies are required to parse JSONL logs and generate token statistics, as the skill operates independently using its built-in scripts for incremental scanning and reporting.