Skip to content
Agent Workspaces
Skill

/hook-failure-audit

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).

From plugin
claude-code-agent-monitor
1.1k75 skills21 agents33 commands1 MCP

Claude Code

$ npx -y skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-failure-audit --agent claude-code

SKILL.md

hook-failure-audit.SKILL.md
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.
Read more
@hoangsonww
Ships withclaude-code-agent-monitor

🚀 A real-time monitoring dashboard for Claude Code & Codex, built with SQLite3, Node.js, Express, React, Vite, TailwindCSS, & WebSockets. It tracks sessions, agent activity, tool usage, and subagent orchestration, providing live analytics, a Kanban status board, status notifications, a cute buddy, & an interactive web UI/MacOS/Windows native app.

1.1k75 skills21 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of hoangsonww/Claude-Code-Agent-Monitor on GitHub, a chart by star-history.com

Other skills on claude-code-agent-monitor.

More skills from other plugins.

paseo

paseo

Paseo reference for managing hosts, projects, workspaces, workspace scripts, agents, schedules, and heartbeats.

paseo9d23k
@getpaseo@getpaseoInstall Skill
10x
Auto-invoked

10x

Personalized audit that teaches the advanced Paradev (formerly Superset) features the user isn't using yet (automations, parallel…

paradevtoday16k
@superset-sh@superset-shInstall Skill
capabilities

capabilities

Your capability catalog — read this at boot. Lists the temporal date-range skills and the external integrations (reached via the…

@chaitanyagiri@chaitanyagiriInstall Skill

Questions about hook-failure-audit.

Which coding agents can use hook-failure-audit?
hook-failure-audit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.