regression-watch — скилл для Claude Code: регрессии по метрикам
Сравнивает старые и свежие окна истории сессий и показывает, какие метрики ухудшились: ошибки, кэш, компакции, цена за сессию.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a claude-codeЧто делает regression-watch
Скилл читает данные Agent Monitor и делит историю на два окна: базовое (старше) и недавнее (новее). По умолчанию недавнее — последние 30 дней, базовое — диапазон 30–90 дней до него. Дальше он считает четыре метрики в каждом окне и говорит, где стало хуже.
Что именно проверяется: доля ошибок (APIError к общему числу событий), попадание в кэш как total_cache_read / (total_cache_read + total_input), частота компакций на сессию и стоимость одной сессии. Падение попадания в кэш означает больше некэшированных входных токенов, то есть рост цены. Рост компакций — контекст стал переполняться чаще.
На выходе — таблица Markdown со столбцами метрика, базовое значение, недавнее, дельта, направление и вердикт. Каждая метрика помечается 🔴, 🟡 или 🟢, валюта в USD с четырьмя знаками после точки, проценты с двумя. Скилл называет сессии, которые сильнее всего повлияли на ухудшение, и заканчивает одной главной регрессией с конкретным следующим шагом. Работает только на чтение: берёт то, что отдаёт API, и базовые значения не додумывает. Без запущенного Agent Monitor с его эндпоинтами скилл ничего не посчитает.
Аргумент можно не указывать — тогда проверяются все метрики. Либо сузить: errors, cache, compaction, cost, или задать окна вроде last 30d и 30 vs 90.
Какие задачи решает
- понять, растёт ли доля ошибок API от недели к неделе
- поймать падение попадания в кэш до того, как вырастет счёт
- увидеть, что компакции стали случаться чаще
- посчитать стоимость одной сессии и сравнить её с прошлым периодом
- найти конкретные сессии, которые тянут метрики вниз
Примеры запросов агенту
- Проверь регрессии по всем метрикам за последние 30 дней
- Сравни окна
30 vs 90и покажи, что ухудшилось - Посчитай регрессию по кэшу и назови сессии, которые её вызвали
Как установить regression-watch
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a claude-code2Вручную: положить файлы
~/.claude/skills/regression-watch/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/regression-watch/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a codex2Вручную: положить файлы
.agents/skills/regression-watch/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a cursor2Вручную: положить файлы
.cursor/skills/regression-watch/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor regression-watch2Вручную: положить файлы
.github/skills/regression-watch/SKILL.md1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a gemini-cli2Командой платформы
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-insights/skills/regression-watchВручную: положить файлы
.devin/skills/regression-watch/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о regression-watch
Как установить regression-watch в Claude Code?
Выполните npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill regression-watch -a claude-code. Скилл окажется в ~/.claude/skills/regression-watch/SKILL.md.
Что делает regression-watch?
Сравнивает базовое и недавнее окна истории сессий и отчитывается, какие метрики стали хуже: доля ошибок, попадание в кэш, частота компакций, стоимость сессии. В конце называет самую приоритетную регрессию и следующий шаг.
Какие аргументы принимает скилл?
Пусто или all — все метрики, errors, cache, compaction, cost — по одной. Окна задаются как last 30d или 30 vs 90.
Исходный текст
SKILL.md · MIT
---
name: regression-watch
description: >
Detect quality and efficiency regressions over time using Agent Monitor data —
rising error rate (APIError events), falling cache hit rate, growing compaction
frequency, and climbing cost-per-session. Splits history into an earlier
baseline window and a recent window and reports which metrics are getting
worse, by how much, and where. Use when checking whether things are degrading
or trending in the wrong direction.
---
# Regression Watch
Detect whether Claude Code sessions are getting worse over time across quality and
efficiency metrics, using Agent Monitor data.
## Input
The user provides: **$ARGUMENTS**
This may be:
- empty or "all" — check every regression metric (default)
- "errors" — error-rate regression only
- "cache" — cache hit-rate regression only
- "compaction" — compaction-frequency regression only
- "cost" — cost-per-session regression only
- A window like "last 30d" or "30 vs 90" — set the recent vs baseline window sizes
## Data Sources
| Endpoint | Returns |
|----------|---------|
| `GET /api/analytics` | `daily_events` (365d), `daily_sessions` (365d), `event_types`, `tokens` (total_input, total_output, total_cache_read, total_cache_write — baselines pre-summed), `avg_events_per_session` |
| `GET /api/events?session_id=X` | Event stream incl. `APIError`, `Compaction`, `PreToolUse`/`PostToolUse` — used to localize regressions to specific sessions |
| `GET /api/pricing/cost` | `{ total_cost, breakdown[...] }` — total cost to derive cost-per-session |
| `GET /api/pricing/cost/{sessionId}` | Per-session cost — used to compare recent vs baseline session cost |
| `GET /api/workflows/{sessionId}` | `compaction` (impact), `errorPropagation` (by depth), `effectiveness` — per-session quality signals |
| `GET /api/sessions?limit=N` | Sessions with `started_at`, `cost`, `metadata` — to bucket sessions into time windows |
## Report Sections
### 1. Windowing
Split history into a **baseline window** (older) and a **recent window** (newer).
Default: recent = last 30 days, baseline = the 30–90 day range before it. Use
`daily_events`/`daily_sessions` for series metrics and `GET /api/sessions?limit=N`
to assign sessions to each window by `started_at`.
### 2. Error Rate Regression
- Recent error rate = `APIError count / total events` in the recent window
(from `event_types` and `daily_events`, or per-session `GET /api/events`).
- Compare to the baseline rate. Flag if recent is higher.
- Report the absolute and relative change and which sessions contributed most
`APIError` events.
### 3. Cache Hit Rate Regression
- Cache hit rate = `total_cache_read / (total_cache_read + total_input)`.
- Compute for each window (per-window input/cache_read from session metadata or
the pricing breakdown). Flag a **falling** hit rate — that means more
uncached input tokens and higher cost.
### 4. Compaction Frequency Regression
- Compaction frequency = `Compaction events / session` per window (from
`event_types` / `daily_events`, confirmed via per-session
`GET /api/workflows/{id}` `compaction`). Flag a **rising** rate — context is
overflowing more often.
### 5. Cost-per-Session Regression
- Cost-per-session = window total cost / window session count, using
`GET /api/pricing/cost` overall and `GET /api/pricing/cost/{id}` for the
sessions in each window. Flag a **climbing** value.
### 6. Verdict
Roll up which metrics regressed, rank by relative worsening, and name the most
likely driver (e.g., cache hit rate fell → cost per session climbed).
## Output
- A Markdown table: metric | baseline | recent | Δ | direction (▲ worse / ▼ better) | verdict.
- Tag each regressed metric 🔴 (clear regression), 🟡 (mild/within noise), or 🟢 (improved).
- Currency in USD to 4 decimals; rates as percentages to 2 decimals.
- List the specific session IDs that contributed most to any regression.
- End with the single highest-priority regression to address and a concrete next step.
- Read-only: only report what the API returns; never fabricate baselines.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor