Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计提醒

claude-usageClaude 使用

Agent Skill

claude-usage 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,035

周安装

44

GitHub Stars

22

下载量

363
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:claude-usage(Claude 使用)
来源仓库:https://github.com/tdimino/claude-code-minoan
仓库路径:skills/claude-usage
安装命令:
npx skills add https://github.com/tdimino/claude-code-minoan --skill claude-usage
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tdimino/claude-code-minoan --skill claude-usage

简介

claude-usage 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 当前无额外底部简介,可参考来源仓库获取完整功能说明。

SKILL.md

Claude Usage

Ground-truth token usage and cost reporting for Claude Code sessions. Parses JSONL files directly—parent sessions and subagent sidechains—to produce accurate numbers.

Why This Exists

ccusage (v18+, the standard community tool with 10.6k stars) undercounts output tokens by 77-94% for heavy users:

SourceOutput TokensNotes
Raw JSONL (all files)1,076,691Ground truth
Raw JSONL (date-filtered)412,987Properly filtered
ccusage --timezone UTC93,96077% undercount
ccusage default62,37594% undercount

Three compounding bugs:

  1. Ignores subagent files at {session-uuid}/subagents/{agent-id}.jsonl—132 files missed on a typical day with Agent Teams
  2. Timezone confusion between UTC entry timestamps and local time filtering
  3. Drops entries in parent files—even at UTC, reports only 23% of actual tokens

This script reads every JSONL file to produce correct totals.


Usage

# Today's usage (default)
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py

# Last 7 days, broken down by day
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --since 7d

# Weekly breakdown for the past month
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --by week --since 30d

# Per-model breakdown
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --by model --since 7d

# Per-session with human-readable summaries
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --by session --since 1d

# Per-project breakdown
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --by project --since 7d

# Filter to one project
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --project Thera --since 30d

# Custom date range
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --since 2026-02-01 --until 2026-02-28

# JSON output (pipe to jq)
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --since 7d --json | jq '.grand_total'

# CSV output
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --since 7d --csv

# Compare against ccusage (shows delta)
python3 ~/.claude/skills/claude-usage/scripts/claude_usage.py --compare

# PDF report (dark editorial, CTO-ready)
python3 ~/.claude/skills/claude-usage/scripts/claude_usage_report.py --since 30d

# PDF with custom output path
python3 ~/.claude/skills/claude-usage/scripts/claude_usage_report.py --since 30d -o ~/Desktop/feb-usage.pdf

# HTML only (no Playwright needed)
python3 ~/.claude/skills/claude-usage/scripts/claude_usage_report.py --since 7d --html

Output Columns

ColumnDescription
InputPrompt tokens (charged at input rate)
OutputResponse tokens (most expensive category)
CacheWCache write tokens (cache_creation_input_tokens)
CacheRCache read tokens (significantly cheaper than input)
TotalSum of all four token types
CostEstimated USD from the hardcoded pricing table

Aggregation Modes (--by)

ModeGroups byExample key
day (default)Calendar date in local timezone2026-02-20
weekISO week number2026-W08
monthMonth2026-02
sessionSession UUID (resolved to summary from sessions-index.json)8a6c801a Working on Claudicle...
modelModel nameclaude-opus-4-6
projectProject directory (decoded to path)~/Desktop/Programming

Pricing Table

Prices are hardcoded in the PRICING dict at the top of claude_usage.py. Update when Anthropic changes rates. Keys are model name substrings matched most-specific-first.

Current defaults (USD per million tokens, verified 2026-02-21):

ModelInputOutputCache Write (1h)Cache Read
Opus 4.5 / 4.6$5.00$25.00$10.00$0.50
Opus 4.0 / 4.1$15.00$75.00$30.00$1.50
Sonnet 4.x$3.00$15.00$6.00$0.30
Haiku 4.5$1.00$5.00$2.00$0.10
Sonnet 3.7 / 3.5$3.00$15.00$6.00$0.30
Haiku 3.5$0.80$4.00$1.60$0.08
Opus 3$15.00$75.00$30.00$1.50
Haiku 3$0.25$1.25$0.50$0.03

Cache write column shows the 1-hour rate (2x base input). Claude Code uses 1-hour prompt caching exclusively. The 5-minute rate (1.25x base input) is also supported when the JSONL cache_creation sub-object provides a TTL split.


Timezone Handling

JSONL timestamps are UTC. The script converts to the system's local timezone (or --tz America/New_York) before applying --since/--until filters. This prevents the midnight-boundary confusion that causes ccusage to drop entries when the UTC date differs from the local date.


Data Sources

JSONL files at ~/.claude/projects/{encoded-path}/:

  • Parent sessions: {session-uuid}.jsonl
  • Subagent sidechains: {session-uuid}/subagents/{agent-id}.jsonl
  • Session metadata: sessions-index.json (summaries for --by session)

The script uses streaming line-by-line reads (O(1) memory) to handle files exceeding 300MB.


PDF Reports

claude_usage_report.py generates a dark editorial PDF with Crimson Pro + JetBrains Mono typography, gold Minoan accents, bar charts, model distribution with color-coded stacked bars, token composition breakdown, and detailed tables. Designed for executive sharing.

Requires Playwright (uv pip install --system playwright && playwright install chromium). Uses Chromium for pixel-perfect CSS rendering—same engine as the Aldea Slide Deck skill. Falls back to HTML output with --html flag.


Caveats

  • Estimated accuracy: ~95%. The remaining gap comes from data residency multipliers (1.1x for US-only inference, not tracked) and potential edge cases in streaming chunk boundaries.
  • Streaming chunks are deduplicated by message ID using last-wins strategy—output_tokens monotonically increases across chunks, so only the final chunk per message ID has the correct value. Without dedup, costs were overcounted by 2-5x.
  • Cost is estimated from the pricing table. Anthropic billing may differ due to batch discounts or promotional pricing.
  • Cache write pricing uses the 1-hour rate by default (Claude Code's caching mode). When JSONL provides cache_creation.ephemeral_5m_input_tokens / ephemeral_1h_input_tokens, rates are split accordingly.
  • Synthetic entries (model: "<synthetic>") and billing error entries (all-zero token counts) are automatically filtered.
  • Malformed JSON lines and duplicate streaming chunks are counted and reported in the output footer.
  • Requires Python 3.9+ for zoneinfo module.
  • PDF reports require Playwright with Chromium (playwright install chromium). Includes a Pricing Methodology section with full rate table, formula, and confidence badge.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.85%
按下载量换算119

Claude

32.27%
按下载量换算117

Cursor

19.35%
按下载量换算70

Gemini CLI

9.51%
按下载量换算35

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills