hook-failure-audit — скилл для Claude Code: суть и установка
Оценивает надёжность передачи хуков по данным Agent Monitor: находит зависшие вызовы инструментов, незакрытые сессии и остановку сбора событий.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a claude-codeЧто делает hook-failure-audit
Скилл инспектирует поток событий дашборда Agent Monitor, проверяя доставку хуков агента, а не внутренние сбои нейросети. Он обращается к локальному API по адресу http://localhost:4820 через эндпоинты GET /api/analytics и GET /api/stats.
Проверка сопоставляет количество хуков PreToolUse и PostToolUse, вычисляя процент потерь при выполнении инструментов. Заодно скилл сверяет финальные сигналы Stop и SubagentStop со статусами завершённых сессий, выявляет зависшие процессы и указывает точные session_id проблемных запусков. Без работающего дашборда на порту 4820 собрать отчёт не получится.
Какие задачи решает
- Найти вызовы инструментов, оставшиеся без закрывающего события PostToolUse
- Выявить сессии и субагенты с пропущенными сигналами Stop или SubagentStop
- Зафиксировать простой сборщика событий при наличии активных запусков
- Получить список идентификаторов сессий с потерянными событиями
Примеры запросов агенту
- Проведи полную диагностику доставки хуков через
hook-failure-audit all. - Сверь количество стартов и завершений инструментов с помощью
hook-failure-audit balance. - Проверь, нет ли зависших сессий и потерь финальных событий, вызвав
hook-failure-audit terminators.
Как установить hook-failure-audit
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a claude-code2Вручную: положить файлы
~/.claude/skills/hook-failure-audit/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/hook-failure-audit/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a codex2Вручную: положить файлы
.agents/skills/hook-failure-audit/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a cursor2Вручную: положить файлы
.cursor/skills/hook-failure-audit/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor hook-failure-audit2Вручную: положить файлы
.github/skills/hook-failure-audit/SKILL.md1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a gemini-cli2Командой платформы
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-quality/skills/hook-failure-auditВручную: положить файлы
.devin/skills/hook-failure-audit/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о hook-failure-audit
Как установить hook-failure-audit в Claude Code?
Выполните команду npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit -a claude-code. Конфигурация запишется в файл ~/.claude/skills/hook-failure-audit/SKILL.md.
Что проверяет скилл hook-failure-audit?
Он анализирует транспорт хуков агента в Agent Monitor, сопоставляя запуски и завершения инструментов, подсчитывает пропущенные терминаторы сессий и сообщает об остановке потока событий.
Что делать, если скилл не может связаться с сервером?
Скилл запрашивает данные через curl с http://localhost:4820. Если сервер недоступен, запустите дашборд командой npm start из корня репозитория Claude-Code-Agent-Monitor.
Исходный текст
SKILL.md · MIT
--- name: hook-failure-audit description: > Audit hook delivery health from Agent Monitor data — balance PreToolUse vs PostToolUse (a gap means tools that started but never reported back), detect missing Stop/SubagentStop terminators (sessions/subagents that never closed), and check for stale ingestion (no recent events). Use when hooks look unreliable or events seem to be dropping. --- # Hook Failure Audit Assess whether the hook pipeline is delivering events reliably, using the event counts and stream the dashboard already has. This is about *delivery* health (missing/dropped events), not about why a model errored. ## Input The user provides: **$ARGUMENTS** This may be: - empty or "all" — run every check (default) - "balance" — PreToolUse/PostToolUse balance only - "terminators" — missing Stop/SubagentStop only - "freshness" — stale-ingestion check only ## Data Sources | Endpoint | Returns | |----------|---------| | `GET /api/analytics` | `event_types` (counts per type: PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd), `daily_events` (365d), `total_subagents`, `sessions_by_status` — fleet-wide delivery balance | | `GET /api/stats` | `total_sessions`, `total_agents`, `total_events`, `events_today` — expected terminator counts and recency | | `GET /api/events?session_id=X` | Per-session stream — confirm which sessions are missing a `PostToolUse`, `Stop`, or `SubagentStop` | ## Report Sections ### 1. PreToolUse / PostToolUse Balance From `GET /api/analytics` `event_types`: `gap = PreToolUse − PostToolUse`. A positive gap means tools whose completion hook never arrived. Report the gap as a count and as a percentage of `PreToolUse`. A healthy pipeline keeps this near 0%. ### 2. Missing Terminators Compare `Stop` count against completed sessions (`sessions_by_status`) and `SubagentStop` against `total_subagents`/`total_agents` (from `/api/stats`). A shortfall means sessions or subagents that ran but never emitted a closing hook — likely dropped delivery or a crashed handler. Report expected vs observed for each. ### 3. Stale Ingestion Check `events_today` from `/api/stats` and the tail of `daily_events` from analytics. If recent days are empty while sessions exist, ingestion has stalled. Report the most recent day with events and how long ago that was. ### 4. Localize For the sessions with the largest gaps or missing terminators, pull `GET /api/events?session_id=X` and confirm which specific hook types are absent. List the offending session IDs. ## Output - A check-by-check report with a PASS / WARN / FAIL marker each (✅ / ⚠️ / ❌) and the expected-vs-observed numbers. - Rates as percentages to 2 decimals. - Cite exact `event_type` counts and `session_id` values — never fabricate. - End with an overall verdict (e.g., "4/4 checks passed" or "hook delivery DEGRADED") and the single highest-impact remediation (e.g., reinstall hooks via the dashboard Settings, or restart the server with `npm start`). - Read-only: only report what the API returns. If `curl` cannot reach `http://localhost:4820`, tell the user to start the dashboard with `npm start` from the repo root.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor