claude-usage-analyst — скилл для Claude Code: разбор расхода токенов
Скилл объясняет, куда ушли токены и деньги в Claude: собирает данные ccusage, показывает модель, кэш и пятичасовые блоки.
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-codeЧто делает claude-usage-analyst
Скилл читает локальные логи Claude через ccusage и превращает их в понятный отчёт: сколько токенов ушло, во что обошлось, какая модель съела больше. Отдельно разбирается кэш — токены чтения кэша тоже давят на квоту, хотя вы этих слов не печатали.
Внутри есть скрипт scripts/analyze_claude_usage.py, который запускается с окном дат и таймзоной. По умолчанию окно — сегодняшний день в выбранной таймзоне, поэтому для сравнения с прошлым периодом нужно задать --since вручную, иначе поля ранжирования и медианы опишут только один день. Для сравнения двух моделей есть --model-a и --model-b.
Перед запуском проверьте, что ccusage установлен: ccusage --version. Если его нет, ставьте через npm install -g ccusage@latest или запускайте npx ccusage@latest. Учтите: ccusage claude видит локальные логи Claude, включая сессии Claude Desktop, но это не полный счёт за обычные чаты Claude.ai. Точные правила квоты по локальным числам не выводятся — без деталей плана это только оценка давления на квоту.
Какие задачи решает
- понять, почему закончилась квота Claude
- посчитать расход токенов за сегодня и за прошлые дни
- сравнить две модели по объёму токенов и стоимости
- объяснить нетехническому человеку, что такое чтение кэша
- разложить расход по пятичасовым блокам
Примеры запросов агенту
- Почему у меня закончилась квота Claude? Разбери по ccusage.
- Сравни fable и opus-4-8 по токенам и стоимости за этот месяц.
- Сколько токенов я потратил сегодня и сколько это стоило?
Как установить claude-usage-analyst
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-code2Вручную: положить файлы
~/.claude/skills/claude-usage-analyst/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/claude-usage-analyst/
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a codex2Вручную: положить файлы
.agents/skills/claude-usage-analyst/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a cursor2Вручную: положить файлы
.cursor/skills/claude-usage-analyst/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install daymade/claude-code-skills claude-usage-analyst2Вручную: положить файлы
.github/skills/claude-usage-analyst/SKILL.md1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a gemini-cli2Командой платформы
gemini skills install https://github.com/daymade/claude-code-skills --path daymade-claude-code/claude-usage-analystВручную: положить файлы
.devin/skills/claude-usage-analyst/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора64
Похожие
Рядом в теме «Настройка агента: память, контекст, субагенты»
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Вопросы о claude-usage-analyst
Как установить claude-usage-analyst в Claude?
Выполните npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-code. После этого файл скилла окажется в ~/.claude/skills/claude-usage-analyst/SKILL.md.
Что делает claude-usage-analyst?
Собирает данные ccusage по локальным логам Claude и объясняет расход токенов, стоимость, состав моделей, работу кэша и пятичасовые блоки. Числа отделяются от трактовки, чтобы было видно, где факт, а где вывод.
Нужен ли ccusage для работы скилла?
Да, скилл опирается на его вывод. Проверьте ccusage --version; если команды нет, поставьте npm install -g ccusage@latest или запускайте через npx ccusage@latest.
Исходный текст
SKILL.md · MIT
---
name: claude-usage-analyst
disable-model-invocation: true
description: Analyze Claude Code and Claude Desktop Code token usage, cost, quota burn, model mix, cache read/write, and 5-hour block consumption using ccusage evidence. Use when the user asks why Claude quota was exhausted, whether a model such as fable/opus/sonnet is unusually expensive, how many tokens were spent today or historically, or needs a human-friendly explanation of local Claude Code CLI/Desktop usage.
---
# Claude Usage Analyst
## Overview
Use this skill to produce evidence-based usage explanations from local `ccusage` data. Separate observed numbers from interpretation, and explain quota burn in human terms.
## Workflow
1. Verify `ccusage` is available:
```bash
ccusage --version
```
If missing, install or update with `npm install -g ccusage@latest` or run with `npx ccusage@latest`.
2. Run the bundled analyzer for the requested window:
```bash
python3 /path/to/claude-usage-analyst/scripts/analyze_claude_usage.py \
--since YYYY-MM-DD --until YYYY-MM-DD --timezone Asia/Shanghai
```
Default `--since/--until` is today in the selected timezone.
For historical comparison, set `--since` to an earlier date such as the first day of the month; otherwise rank/median fields only describe the single target day.
3. If the user asks about a specific model comparison, pass aliases:
```bash
python3 scripts/analyze_claude_usage.py --model-a fable --model-b opus-4-8
```
4. Read `references/explanation-guide.md` when writing the final answer.
## Evidence Rules
- Base numeric claims on `ccusage` output or the bundled analyzer output.
- State the scope: `ccusage claude` measures local Claude Code usage logs, including Claude Desktop's Claude Code sessions when those local logs exist. It is not a complete ordinary Claude.ai chat bill.
- Report dates with timezone.
- Explain cache clearly: cache read tokens are still usage/quota pressure even though the user did not type those words.
- Do not infer Anthropic plan quota rules from local token counts unless the user provides plan details. Say "quota-like pressure" or "ccusage estimated cost/token burn" when exact plan accounting is unknown.
- When comparing models, compare both token volume and estimated cost. A model can have similar token volume but higher cost.
## Output Shape
Use this structure unless the user asks otherwise:
1. Short conclusion in plain language.
2. Evidence table: total tokens, cost, input, output, cache create, cache read.
3. Model comparison table.
4. 5-hour block table when quota exhaustion is discussed.
5. Explanation of why the burn happened.
6. Confidence and caveats.
Keep the answer readable for non-technical users. Avoid unexplained terms like "cache read" without a one-sentence translation.
© daymade · MIT · daymade/claude-code-skills