hook-diagnostics

hook-diagnostics is a skill for Claude Code, Codex from hoangsonww/Claude-Code-Agent-Monitor. It costs 41 tokens per session (630 once invoked), scanned B, original, MIT.

A troubleshooting guide for Claude Code hooks, which are small handlers that pass activity events to Agent Monitor, a local dashboard. It checks whether the hooks are installed, connected, and sending events.

In plain words
What is it for?
Use it to diagnose hook installation, dashboard connection, handler, or event-flow problems.
Why use it?
It helps find why session activity is missing from the dashboard by checking setup, connectivity, and event delivery separately.

Skill for Claude CodeCodex

Written for Claude Code and Codex: $ARGUMENTS substitution, but also agents/openai.yaml present. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the ccam-devtools plugin — 6 skills, 3 commands, 2 agents shipped together

Good fit Use it to diagnose hook installation, dashboard connection, handler, or event-flow problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-diagnostics
Clone the repo
git clone --depth 1 https://github.com/hoangsonww/Claude-Code-Agent-Monitor

Made for: Claude Code, Codex.

Or install ccam-devtools, the plugin that ships this one along with the rest of its 6 skills, 3 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hook-diagnostics

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics/github.svg)](https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics)
Your own site
<a href="https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics"><img src="https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hook-diagnostics

Your own site · 80×15
<a href="https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics"><img src="https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/hook-diagnostics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 630 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 32
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 32
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • medium Data Exfiltration · line 67
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.00630
Opus 5 $0.00020 $0.00315
Sonnet 5 $0.00008 $0.00126
Haiku 4.5 $0.00004 $0.00063

Measured 8d ago against content hash 7353b3f9c375, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

hook-diagnostics scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/settings.json | jq '.hooks // empty'

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sf http://localhost:4820/api/health
plugins/ccam-devtools/skills/hook-diagnostics/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hook Diagnostics

Diagnose hook integration issues between Claude Code and the Agent Monitor.

Input

The user provides: $ARGUMENTS

This may be:

  • "full" or empty (default: run all diagnostics)
  • "install" to check hook installation only
  • "connectivity" to check dashboard connectivity only
  • "events" to check event delivery only

Procedure

Run diagnostic checks in this order:

1. Hook Installation Check

Verify hooks are installed in Claude Code settings:

# Check if hooks exist in Claude Code settings
cat ~/.claude/settings.json | jq '.hooks // empty'

Verify:

  • All 7 expected hook types are registered: PreToolUse, PostToolUse, Stop, SubagentStop, Notification, SessionStart, SessionEnd
  • Hook commands point to the correct handler script path
  • Handler script exists and is readable at the configured path

2. Dashboard Connectivity

Test that the dashboard API is reachable:

curl -sf http://localhost:4820/api/health

Verify:

  • Dashboard responds with 200 OK
  • Response includes expected health fields
  • WebSocket endpoint is accessible

3. Hook Handler Validation

Check the hook handler script:

# Verify handler exists and is executable
ls -la <handler-path>
# Syntax check
node --check <handler-path>

4. Event Delivery Test

Send a test event and verify it arrives:

echo '{"hook_type":"test","session_id":"diag-test","data":{}}' | \
  curl -sf -X POST http://localhost:4820/api/hooks/event \
  -H 'Content-Type: application/json' -d @-

5. Database Check

Verify the database is writable and events are persisted:

curl -sf http://localhost:4820/api/stats
curl -sf http://localhost:4820/api/events?limit=5

6. Recent Event Flow

Check if events are flowing:

  • Time since last event received
  • Events received in last hour
  • Any gaps in event delivery

Output Format

Present as a diagnostic report with:

Hook Diagnostics Report
━━━━━━━━━━━━━━━━━━━━━━
✅ Hook Installation .............. PASS
✅ Dashboard Connectivity ......... PASS
✅ Handler Script ................. PASS
⚠️ Event Delivery ................ WARN (slow)
✅ Database ....................... PASS
❌ Recent Event Flow .............. FAIL (no events in 2h)
━━━━━━━━━━━━━━━━━━━━━━
Overall: 5/6 checks passed

Read the full file on GitHub · 105 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 105 lines · 41 tokens per session scan B 7353b3f9c375

Subscribe to this mod's changes

hook-diagnostics is a skill published in the GitHub repository hoangsonww/Claude-Code-Agent-Monitor (991 stars, last pushed 3d ago), licensed MIT. It adds 41 tokens to every session and 630 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.