benchmark: скилл для сравнения сессии с нормой · hoangsonww
Скилл benchmark берёт одну сессию или несколько последних и сравнивает их с накопленным средним по данным Agent Monitor: стоимость, токены, число вызовов инструментов и оценка сложности.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a claude-codeЧто делает benchmark
Скилл читает данные Agent Monitor через его API. Список сессий даёт базу для сравнения, эндпоинт стоимости отдаёт расход и разбивку по токенам, эндпоинт воркфлоу — число инструментов и оценку сложности, аналитика подтверждает средние по популяции.
На вход подаётся ID сессии, слово latest для последней, latest N для нескольких последних или ничего — тогда берётся самая свежая. Для каждой метрики скилл считает среднее, медиану и стандартное отклонение по популяции, затем процентиль целевой сессии и z-оценку. По модулю z больше 2 метка становится «выброс».
В отчёте — таблица Markdown: метрика, значение сессии, среднее по популяции, процентиль, z-оценка и метка. Валюта в долларах с четырьмя знаками после точки, токены и число инструментов целыми, сложность с двумя знаками. Рост отмечается значком ▲, падение — ▼. Внизу одна строка вывода: «Normal session» или «Outlier — driven by <metric> (pNN)». Если сессия выбилась, скилл называет метрику, которая её вытянула.
База только из полученной популяции. Ничего не досчитывается на глаз — это важно, если вы потом опираетесь на цифры в разборе.
Какие задачи решает
- Понять, была ли сессия обычной по расходу и объёму
- Найти метрику, из-за которой сессия выбилась из нормы
- Сравнить несколько последних сессий с одной базой
Примеры запросов агенту
- Сравни сессию
a1b2c3со средней по последним 200 сессиям - Прогони benchmark по
latestи скажи, нормальная она или выброс - Сравни
latest 5с накопленным средним по каждой метрике
Как установить benchmark
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a claude-code2Вручную: положить файлы
~/.claude/skills/benchmark/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/benchmark/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a codex2Вручную: положить файлы
.agents/skills/benchmark/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a cursor2Вручную: положить файлы
.cursor/skills/benchmark/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor benchmark2Вручную: положить файлы
.github/skills/benchmark/SKILL.md1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a gemini-cli2Командой платформы
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-insights/skills/benchmarkВручную: положить файлы
.devin/skills/benchmark/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о benchmark
Как установить benchmark в Claude Code?
Выполните npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill benchmark -a claude-code. Файл скилла окажется по пути ~/.claude/skills/benchmark/SKILL.md.
Что делает benchmark?
Считает по сессии стоимость, суммарные токены, число инструментов и оценку сложности, а потом показывает, в каком проценте популяции каждая метрика и насколько она отклонилась от среднего.
Откуда берётся база для сравнения?
Из данных Agent Monitor: список сессий строит накопленное среднее, эндпоинты стоимости и воркфлоу дают метрики целевой сессии. Процентили считаются только по полученной популяции.
Исходный текст
SKILL.md · MIT
---
name: benchmark
description: >
Benchmark one session (or a small recent set) against the rolling average using
Agent Monitor data — cost, total tokens, tool count, and workflow complexity
score — and report where each metric lands as a percentile of the population.
Tells you whether a session was normal, cheap, or an outlier. Use when judging
whether a session was typical or out of band.
---
# Benchmark
Score a session against the rolling population average and report its percentile on
cost, tokens, tool count, and complexity using Agent Monitor data.
## Input
The user provides: **$ARGUMENTS**
This may be:
- A single session ID — benchmark that session
- "latest" — benchmark the most recent session
- "latest N" — benchmark the N most recent sessions, each vs the average
- empty — benchmark the most recent session (default)
## Data Sources
| Endpoint | Returns |
|----------|---------|
| `GET /api/sessions?limit=N` | Population of sessions with `cost`, `model`, `started_at`, `metadata` (turn_count, total_turn_duration_ms) — builds the rolling baseline |
| `GET /api/pricing/cost/{sessionId}` | `{ total_cost, breakdown:[{ input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost }] }` — the target session's cost and tokens |
| `GET /api/workflows/{sessionId}` | `complexity` (score), `stats` (tool/event counts), `toolFlow` (distinct tools used) — the target session's tool count and complexity |
| `GET /api/analytics` | `avg_events_per_session`, `tool_usage`, `daily_sessions` — corroborates population-level averages |
## Report Sections
### 1. Build the Baseline
Fetch the population with `GET /api/sessions?limit=200` (the rolling set). For each
session gather cost (`GET /api/pricing/cost/{id}` or the list `cost` field), total
tokens (sum of the 4 token types from the pricing breakdown), tool count and
complexity (`GET /api/workflows/{id}`). Compute mean, median, and standard
deviation for each metric across the population.
### 2. Measure the Target
For the requested session, pull the same four metrics:
- **Cost** — `total_cost` from `GET /api/pricing/cost/{id}`.
- **Total tokens** — `input + output + cache_read + cache_write` summed from the breakdown.
- **Tool count** — distinct/total tools from `GET /api/workflows/{id}` `stats`/`toolFlow`.
- **Complexity score** — `complexity.score` from `GET /api/workflows/{id}`.
### 3. Percentile and Deviation
For each metric report the target's percentile within the population (share of
sessions at or below it) and its z-score `(value − mean) / stddev`. Label each:
below average / typical / above average / outlier (|z| > 2).
### 4. Verdict
State whether the session was normal overall. If it is an outlier, name which
metric drove it (e.g., complexity p96, cost p91 → an unusually heavy session).
## Output
- A Markdown table: metric | session value | population mean | percentile | z-score | label.
- Currency in USD to 4 decimals; tokens and tool counts as integers; complexity to 2 decimals.
- Use ▲ for above-average and ▼ for below-average vs the mean.
- One-line verdict: "Normal session" or "Outlier — driven by <metric> (pNN)".
- When benchmarking multiple sessions, one row block per session plus a summary line.
- Read-only: percentiles come only from the fetched population; never fabricate the baseline.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor
Похожие скиллы
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Сначала — benchmark от других авторов.