Hook inventory
Skill hoangsonww/Claude-Code-Agent-Monitor/plugins/ccam-config/skills/hook-inventory
Inventory hooks across the user, project, and project-local settings plus the ~/.claude/hooks scripts directory — read through the Agent Monitor Config Explorer API — and flag hooks that POST to the network or run arbitrary commands. Reads /api/cc-config/hooks and /api/cc-config/hook-scripts. Use when auditing hook safety.From its SKILL.md
npx -y skills add hoangsonww/Claude-Code-Agent-Monitor --skill hook-inventoryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- fetches URLsInstructs the agent to fetch 2 URLs, including http://localhost:4820/api/cc-config/hooks and 1 more.
SKILL.md
3.1 KB, 721 tokens by cl100k_base, as published. Nobody here has run it
Hook Inventory
Catalogue every Claude Code hook the user has configured and assess its safety —
read through the Agent Monitor dashboard at http://localhost:4820.
Input
The user provides: $ARGUMENTS
This may be:
- empty — inventory all hooks across every scope (default).
- an event name (
PreToolUse,PostToolUse,Stop,SubagentStop,SessionStart,SessionEnd,UserPromptSubmit,Notification,PreCompact) — restrict to that event. - "scripts" — focus on the
~/.claude/hookshandler scripts dir.
Data Sources
| Endpoint | Returns |
|---|---|
GET /api/cc-config/hooks | { items:[{ scope:"user"|"project"|"project-local", file, exists, hooks:{ <Event>:[{ matcher, type, command, timeout }] } }] } |
GET /api/cc-config/hook-scripts | { dir, items:[{ name, file, size, mtime }] } — the handler scripts under ~/.claude/hooks/ |
Report Sections
1. Configured hooks by scope
From /hooks, flatten each source into (scope, file, Event, matcher, type, command, timeout). Group by scope (user, project, project-local). Show the
event, matcher, hook type, and the raw command. Note which file each came
from so the user can edit the right one.
2. Hook scripts on disk
From /hook-scripts, list each file in ~/.claude/hooks/ with name, size
(KB), and mtime. Cross-reference: flag scripts referenced by a hook command
but missing from disk, and scripts on disk that no configured hook calls
(orphaned).
3. Safety flags
For every type: "command" entry escalate:
- Network egress (P0) — the command contains
curl,wget,http,https,nc, or pipes output off-box. Print the destination if visible. - Arbitrary execution (P1) — pipes to
sh/bash, evaluates downloaded content, or runs an unpinned interpreter on attacker-influenceable input. - No timeout (P2) — a
commandhook withtimeout: null; it can hang a session indefinitely. - Broad matcher (P3) —
matcher: "*"or empty on a destructive command.
Output
- Section 1 as a table (
Scope | Event | Matcher | Type | Command | Timeout). - Section 3 as a findings table (
Hook | Risk | Severity | Detail) with a one-line verdict first (SAFE / REVIEW NEEDED / RISKY HOOKS). - Print raw commands verbatim — do not paraphrase a command you are flagging.
- Cite only fields the API returned — never fabricate hooks or commands.
- Note: hooks live inside settings.json and are read-only via the Config
Explorer; edit them in the
filenamed by the source, then reinstall with the dashboard's hook setup if needed. - If the dashboard is unreachable at
http://localhost:4820, say so and tell the user to start it withnpm startfrom the repo root.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most operations skills give in 721 tokens
Counted across 483 of the 484 authors here whose files we hold, read 2026-08-07
- Collect monitoring data throughout the simulationin 14 of 483, across 6 files
- Set the random seed for reproducibilityin 14 of 483, across 6 files
- Validate simulations against analytical solutionsin 12 of 483, across 4 files
- Clarify goals, constraints, and inputsin 11 of 483, across 2 files
- Implement contract tests for integration pointsin 11 of 483, across 2 files
- Implement strangler fig infrastructure with API gatewayin 11 of 483, across 2 files
- Audit modernized components for security vulnerabilitiesin 11 of 483, across 2 files
- Avoid Python blocking calls in processesin 10 of 483, across 3 files
- Use resource context managers for automatic cleanupin 9 of 483, across 2 files
- Maintain consistent time unitsin 9 of 483, across 2 files
- Validate outcomes against success criteriain 8 of 483, across 1 file
- Analyze the legacy codebase for technical debtin 8 of 483, across 1 file
Said here and by no other author read
- flatten hooks into scope, file, event, matcher, type, command, and timeout
- group configured hooks by scope
- list each handler script with name, size, and modification time
- cross-reference hook commands against scripts on disk
- flag network egress commands as P0
- flag arbitrary execution commands as P1
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.