/Catalogue/Prompt/hoangsonww/hoangsonww-claude-code-agent-monitor-hook-inventory

Origin: github

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.

by hoangsonww · updated 21h ago · imported from GitHub

Installs0+0/7d
Security score0/100
Retention 14d0%
GitHub stars1K

Skill logic

Execution graph
User message
Prompt rewrites behaviour
Response

SKILL.md

View on GitHub ↗

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/hooks handler scripts dir.

Data Sources

EndpointReturns
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 command hook with timeout: 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 file named 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 with npm start from the repo root.

Discussion

No comments yet — start the thread.

Sign in to join the discussion.

/More from hoangsonww/Claude-Code-Agent-Monitor

hoangsonww· 21h agoSandbox
config-audit

Prompts · TypeScript · v0.1.0

Run a full audit of the user's Claude Code configuration via the Agent Monitor Config Explorer API: counts per surface (user vs project), duplicate or overlapping skills and subagents, hooks that run shell commands, and which surfaces are read-only vs mutable. Reads /api/cc-config/overview, /skills, /agents, /commands, /hooks, and /settings. Use when reviewing your Claude Code setup for sprawl, duplication, or risk.

#ai-agents#claude-agents#claude-code

0 1K
hoangsonww· 21h agoSandbox
mcp-audit

Prompts · TypeScript · v0.1.0

Audit the configured MCP servers (user + project scope) via the Agent Monitor Config Explorer API: transport (stdio vs http), command/args and env variable names, headers, and the source file each definition came from. Reads /api/cc-config/mcp. Use when reviewing MCP integrations for hygiene, duplication, or unexpected transports.

#ai-agents#claude-agents#claude-code

0 1K
hoangsonww· 21h agoSandbox
memory-review

Prompts · TypeScript · v0.1.0

Review the file-based memory store via the Agent Monitor Config Explorer API: the user and project CLAUDE.md plus per-project auto-memory files under ~/.claude/projects/<slug>/memory/*.md. Groups by project, shows the index (MEMORY.md) vs per-fact files, and flags stale or oversized facts. Reads /api/cc-config/memory and /api/cc-config/file?path=. Use when curating agent memory.

#ai-agents#claude-agents#claude-code

0 1K
hoangsonww· 21h agoSandbox
skill-inventory

Prompts · TypeScript · v0.1.0

Inventory the installed skills and which plugins contribute them, then flag overlap with the user's own skills — read through the Agent Monitor Config Explorer API. Reads /api/cc-config/skills and /api/cc-config/plugins. Use when managing skills: deduping, deciding what to keep, or tracing a skill back to the plugin that ships it.

#ai-agents#claude-agents#claude-code

0 1K