cwd-rollup — скилл для Claude Code: что делает и как установить
Сводит сессии Claude Code по рабочим директориям через данные Agent Monitor. Показывает число запусков, расходы в долларах, токены и время последней активности по каждому проекту.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a claude-codeЧто делает cwd-rollup
Скилл собирает статистику по проектам из локального сервиса Agent Monitor. Он отправляет запросы к эндпоинтам /api/run/cwds, /api/sessions?limit=1000 и /api/pricing/cost, группируя сессии по рабочим каталогам. Для каждой папки вычисляются число запусков, сумма расходов в долларах, список моделей и время последней активности. Токены делятся на входные, выходные и кэш.
Результат выводится в Markdown-таблице с сортировкой по убыванию стоимости. Точность цен — четыре знака после запятой. Аргументы позволяют отфильтровать вывод по подстроке пути или ограничить список параметром top N. Без запущенного дашборда Agent Monitor сбор данных не сработает: сначала придётся выполнить npm start в корне репозитория монитора. Если у сессии нет поля usage_extras, токены для неё исключаются из отчёта.
Какие задачи решает
- Сравнить расходы на Claude Code между разными рабочими директориями
- Найти проекты с наибольшим потреблением токенов и затратами в долларах
- Узнать время последней активности и список моделей для конкретной папки
- Рассчитать процентную долю каждого каталога в общих тратах на флот
Примеры запросов агенту
- Сведи сессии Claude Code по всем рабочим директориям
- Покажи топ 5 самых дорогих проектов через cwd-rollup
- Сделай сводку по папкам с подстрокой backend
Как установить cwd-rollup
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a claude-code2Вручную: положить файлы
~/.claude/skills/cwd-rollup/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/cwd-rollup/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a codex2Вручную: положить файлы
.agents/skills/cwd-rollup/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a cursor2Вручную: положить файлы
.cursor/skills/cwd-rollup/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor cwd-rollup2Вручную: положить файлы
.github/skills/cwd-rollup/SKILL.md1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a gemini-cli2Командой платформы
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-sessions/skills/cwd-rollupВручную: положить файлы
.devin/skills/cwd-rollup/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о cwd-rollup
Как установить cwd-rollup в Claude Code?
Выполните команду npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cwd-rollup -a claude-code. Альтернативный путь размещения файла — ~/.claude/skills/cwd-rollup/SKILL.md.
Что делает скилл cwd-rollup?
Он запрашивает данные у сервиса Agent Monitor и группирует сессии по рабочим каталогам. На выходе формируется Markdown-таблица с расходами в долларах, токенами, числом сессий и долей проекта в общем бюджете.
Что делать, если дашборд Agent Monitor недоступен?
Скилл не сможет получить данные через локальный API без работающего сервиса. Запустите дашборд командой npm start в корне репозитория Agent Monitor перед вызовом скилла.
Исходный текст
SKILL.md · MIT
---
name: cwd-rollup
description: >
Roll up Claude Code sessions by working directory (project) from Agent Monitor
data — session count, total cost, total tokens, and last-active timestamp per cwd
— so per-project activity can be compared at a glance. Use when summarizing where
effort and spend went across projects.
---
# CWD Rollup
Aggregate session activity per working directory (project).
## Input
The user provides: **$ARGUMENTS**
- Empty → roll up **all** working directories.
- A path / project substring → restrict the rollup to matching cwds.
- `top N` → keep only the N highest-cost (or highest-count) projects.
## Data Sources
| Endpoint | Returns |
|----------|---------|
| `GET /api/run/cwds` | the distinct working directories that have sessions — the rollup key set |
| `GET /api/sessions?limit=N` | session list: id, status, model, cwd, started_at, ended_at, cost, metadata (usage_extras with token counts) |
| `GET /api/pricing/cost` | fleet cost: total_cost, breakdown[{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] — for the fleet total to compute each cwd's share |
## Report Sections
### 1. Key set
`GET /api/run/cwds` for the canonical list of working directories. Apply the
`$ARGUMENTS` filter (substring match) if one was given.
### 2. Pull sessions
`GET /api/sessions?limit=1000`. Bucket sessions by `cwd`.
### 3. Aggregate per cwd
For each working directory compute:
- **sessions** — count.
- **cost** — sum of the inline `cost` field across the bucket.
- **tokens** — sum of input / output / cache-read / cache-write from each session's
metadata `usage_extras` (sum the four into a total, and keep input + output as the
"billable text" subtotal).
- **last active** — the max `started_at` (or `ended_at`) in the bucket.
- **models** — the distinct models seen.
### 4. Share of fleet
`GET /api/pricing/cost` for `total_cost`; show each cwd's cost as a percentage of the
fleet total.
### 5. Ranking
Sort by cost descending by default (or count if the user asked); apply `top N`.
## Output
Markdown table: `project (cwd basename) | sessions | total tokens | cost | % of fleet | last active | models`.
Currency as USD to 4 decimal places; token counts with thousands separators; sort
cost-descending. Add a final TOTAL row summing the columns. Only count tokens that
the session metadata actually carries — if `usage_extras` is absent for a session,
note it as excluded rather than guessing. If the dashboard is unreachable, tell the
user to start it with `npm start` from the repo root.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor