hook-guard

hook-guard is a skill for Claude Code from musingfox/cc-plugins. It costs 66 tokens per session (1,112 once invoked), scanned A, original, MIT.

A setup, diagnostic, and update workflow for project hooks: scripts that run automatically during coding or Git actions. It manages checks for security, code quality, formatting, tests, and commit messages.

In plain words
What is it for?
Use it to set up, inspect, or refresh Claude Code hooks and Git pre-commit or commit-message checks, with support for project languages, tools, and repository structure.
Why use it?
It helps teams install or maintain automatic checks without losing track of existing hooks or project-specific settings.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the hook-guard plugin — 1 skill shipped together

Good fit Use it to set up, inspect, or refresh Claude Code hooks and Git pre-commit or commit-message checks, with support for project languages, tools, and repository structure.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/musingfox/cc-plugins/hook-guard
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 musingfox/cc-plugins --skill hook-guard
Clone the repo
git clone --depth 1 https://github.com/musingfox/cc-plugins

Made for: Claude Code.

Or install hook-guard, the plugin that ships this one along with the rest of its 1 skill.

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-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/musingfox/cc-plugins/hook-guard/github.svg)](https://agentmods.dev/skills/musingfox/cc-plugins/hook-guard)
Your own site
<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.

agentmods 80×15 button for hook-guard

Your own site · 80×15
<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>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,112 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00066 $0.01112
Opus 5.5 $0.00026 $0.00445
Sonnet 5.5 $0.00013 $0.00222
Haiku 4.5 $0.00007 $0.00111

Measured 1mo ago against content hash 9e92e36b9619, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

hook-guard/skills/hook-guard/SKILL.md · 74 lines

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.

  1. Detect — follow references/detection.md. Collect: languages, toolchain, VCS, existing hooks, monorepo. If existing hooks found, ask merge / replace / abort.
  2. Recommend — read .claude/hook-guard.local.md if present. Present summary grouped by: pre-commit security / integrity / structure, pre-commit quality (lint / format / test), commit-msg. Ask to confirm.
  3. Generate:
    • .githooks/pre-commit from references/pre-commit-checks.md — only enabled checks, real tool commands substituted. chmod +x.
    • .githooks/commit-msg from references/commit-msg.md if enabled. chmod +x.
    • Run git config core.hooksPath .githooks.
    • Ensure .claude/*.local.md gitignored.
  4. Verify — bash -n .githooks/pre-commit, then in a scratch repo (git init in a temp dir, core.hooksPath pointing 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.
  5. 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.

  1. git config core.hooksPath — must equal .githooks. Unset = FAIL. Other = WARN.
  2. Hook files — .githooks/pre-commit and (if conventional commits) .githooks/commit-msg: exist + executable.
  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 sets, so Claude's commits go unchecked. grep -q 'CLAUDECODE' .githooks/pre-commit or grep -q 'CLAUDE_TOOL_ARG_' .claude/settings.local.json = FAIL.
  4. Tools — grep pre-commit for tool names (ruff, eslint, prettier, gitleaks, jq, python3…); command -v each.
  5. Settings file — validate .claude/hook-guard.local.md frontmatter (schema in references/settings.md); warn on unknown fields.
  6. (Optional) Dry-run — offer to execute .githooks/pre-commit on current tree.

Read the full file on GitHub · 74 lines

Files

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.

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. 1mo ago Changed · +1 lines 9e92e36b9619
  2. 2mo ago Changed · -3 lines · -3 tokens per session 0e3ffa49ba7f
  3. 2mo ago Changed · -3 lines · -43 tokens per session c9dd2343d116
  4. 3mo ago First seen · 79 lines · 112 tokens per session scan A 68414f821dc4

Subscribe to this mod's changes

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.

Related

hook-guard compared with skills from other repositories

hook-guard next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
hook-guardmusingfox/cc-pluginsSkill24d agoMITA66Claude Code
create-prprisma/ormSkill48ktodayApache-2.0A47Claude Code, Codex
git-commitThinkInAIXYZ/deepchatSkill6.4kyesterdayApache-2.0A15Claude Code, Codex
engineer-bot-opsmakecindy/cindySkill11kyesterdayApache-2.0A57Claude Code, Codex
mcore-split-prNVIDIA/skillsSkill4.2k3d agoApache-2.0A25Claude Code
contributingHugoRCD/evlogSkill2.0kyesterdayMITA68Claude Code, Codex
git-commit-writermergisi/awesome-openclaw-agentsSkill4.1k26d agoMITA53Claude Code, Codex