thaitype/skills · Archived

claude-usage

Show token usage and estimated API cost for a Claude Code session. Use when the user asks about session cost, how much a session spent, token breakdown, API usage, or wants to analyze spend over a date range.

First seen Aug 20, 2026

Installation

$ npx skills add thaitype/skills --skill claude-usage

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thaitype/skills · top by installs.

npx skills add thaitype/skills

Browse all from thaitype/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 13
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,789 B
  • docs SUMMARY.md 228 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2 installs

SKILL.md

Claude Usage

Aggregates token usage and calculates estimated API cost from a session's .jsonl file.

Commands

# Show total usage for a session (falls back to $AGENT_SESSION_ID if no arg)
python3 .claude/skills/claude-usage/scripts/usage_summary.py <session-id>

# Filter by date range (ISO format, date-only or datetime)
python3 .claude/skills/claude-usage/scripts/usage_summary.py <session-id> --start 2026-03-01
python3 .claude/skills/claude-usage/scripts/usage_summary.py <session-id> --start 2026-03-01T09:00:00 --end 2026-03-16T23:59:59

# Use custom projects directory
python3 .claude/skills/claude-usage/scripts/usage_summary.py <session-id> --dir /path/to/projects

Output

  Session: <id>
  Period:  2026-03-01 09:00  →  2026-03-16 18:42
  Turns:   42

  Tokens
    Input:        1.2m
    Cache write:  45.3k
    Cache read:   890.1k
    Output:       123.4k

  Estimated cost: $1.2345

  By model:                           (shown only if session used multiple models)
    claude-sonnet-4-6               38 turns  $1.10
    claude-opus-4-6                  4 turns  $0.13

How cost is calculated

Each assistant turn's tokens are multiplied by the model's per-token price and summed:

Token type Billed as
input_tokens input price
cache_creation cache write
cache_read cache read
output_tokens output price

Prices are estimates based on public Anthropic pricing. Actual billing may differ.