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.
npx skills add musingfox/cc-plugins --skill hook-guardgit clone --depth 1 https://github.com/musingfox/cc-pluginsWrote 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.
[](https://agentmods.dev/skills/musingfox/cc-plugins/hook-guard)<a href="https://agentmods.dev/skills/musingfox/cc-plugins/hook-guard"><img src="https://agentmods.dev/badge/skills/musingfox/cc-plugins/hook-guard/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.
<a href="https://agentmods.dev/skills/musingfox/cc-plugins/hook-guard"><img src="https://agentmods.dev/badge/skills/musingfox/cc-plugins/hook-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00066 | $0.01112 |
| Opus 5.5 | $0.00026 | $0.00445 |
| Sonnet 5.5 | $0.00013 | $0.00222 |
| Haiku 4.5 | $0.00007 | $0.00111 |
Grade A, and why
hook-guard scanned grade A with 1 finding 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 1mo 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 directorieslowAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
3. **Legacy Claude skip** — older hook-guard installs skip lint / format / test when `CLAUDECODE` is set and hand them to `.claude/settings.local.json` hooks that read `$CLAUDE_TOOL_ARG_*`, a variable Claude Code never s Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hook Guard
Dispatch by user intent:
- Setup — install is missing or user asks to set up / configure / initialize
- Doctor — user asks to check / diagnose / verify / troubleshoot
- Update — install exists and user asks to update / refresh / regenerate / sync
If ambiguous: if .githooks/pre-commit exists → default to Doctor; otherwise → Setup.
Read references/settings.md for the user-override schema (.claude/hook-guard.local.md) — applies to all three modes.
Setup
Skip if the user only wants to edit existing hooks. If jj-native only (no .git/), abort — pre-commit hooks not supported.
- Detect — follow
references/detection.md. Collect: languages, toolchain, VCS, existing hooks, monorepo. If existing hooks found, ask merge / replace / abort. - Recommend — read
.claude/hook-guard.local.mdif present. Present summary grouped by: pre-commit security / integrity / structure, pre-commit quality (lint / format / test), commit-msg. Ask to confirm. - Generate:
.githooks/pre-commitfromreferences/pre-commit-checks.md— only enabled checks, real tool commands substituted.chmod +x..githooks/commit-msgfromreferences/commit-msg.mdif enabled.chmod +x.- Run
git config core.hooksPath .githooks. - Ensure
.claude/*.local.mdgitignored.
- Verify —
bash -n .githooks/pre-commit, then in a scratch repo (git initin a temp dir,core.hooksPathpointing at the generated hooks) stage one clean file and one that trips a warning (e.g. trailing whitespace), and run the hook. Expect exit 0 with the warning printed. Any syntax error, unreplaced placeholder, or unexpected failure: return to Generate. - Summary — files touched, onboarding cmd (
git config core.hooksPath .githooks), mention Doctor / Update modes.
Doctor
Run all checks, present a status table (✓ / ✗ / ⚠ / ℹ), then offer auto-fix for FAIL/WARN.
git config core.hooksPath— must equal.githooks. Unset = FAIL. Other = WARN.- Hook files —
.githooks/pre-commitand (if conventional commits).githooks/commit-msg: exist + executable. - Legacy Claude skip — older hook-guard installs skip lint / format / test when
CLAUDECODEis set and hand them to.claude/settings.local.jsonhooks that read$CLAUDE_TOOL_ARG_*, a variable Claude Code never sets, so Claude's commits go unchecked.grep -q 'CLAUDECODE' .githooks/pre-commitorgrep -q 'CLAUDE_TOOL_ARG_' .claude/settings.local.json= FAIL. - Tools — grep pre-commit for tool names (ruff, eslint, prettier, gitleaks, jq, python3…);
command -veach. - Settings file — validate
.claude/hook-guard.local.mdfrontmatter (schema inreferences/settings.md); warn on unknown fields. - (Optional) Dry-run — offer to execute
.githooks/pre-commiton current tree.
What ships with it
4 files 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.
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.
- 1mo ago Changed · +1 lines 9e92e36b9619
- 2mo ago Changed · -3 lines · -3 tokens per session 0e3ffa49ba7f
- 2mo ago Changed · -3 lines · -43 tokens per session c9dd2343d116
- 3mo ago First seen · 79 lines · 112 tokens per session scan A 68414f821dc4
hook-guard is a skill published in the GitHub repository musingfox/cc-plugins (2 stars, last pushed 4d ago), licensed MIT. It adds 66 tokens to every session and 1,112 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
hook-guard compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| hook-guardmusingfox/cc-plugins | Skill | 2 | 4d ago | MIT | A | 66 | Claude Code |
| create-prprisma/orm | Skill | 48k | today | Apache-2.0 | A | 47 | Claude Code, Codex |
| git-commitThinkInAIXYZ/deepchat | Skill | 6.4k | yesterday | Apache-2.0 | A | 15 | Claude Code, Codex |
| engineer-bot-opsmakecindy/cindy | Skill | 11k | yesterday | Apache-2.0 | A | 57 | Claude Code, Codex |
| mcore-split-prNVIDIA/skills | Skill | 4.2k | 3d ago | Apache-2.0 | A | 25 | Claude Code |
| contributingHugoRCD/evlog | Skill | 2.0k | yesterday | MIT | A | 68 | Claude Code, Codex |
| git-commit-writermergisi/awesome-openclaw-agents | Skill | 4.1k | 26d ago | MIT | A | 53 | Claude Code, Codex |