hooks

Ready-made templates for hooks, automated commands that run before or after an agent tool changes a file. The included examples run checks such as strict MkDocs builds and linting.

In plain words
What is it for?
Use them to add checks to Claude settings, including detecting broken documentation links, missing navigation pages, template errors, and other project-specific lint or quality failures.
Why use it?
They catch documentation and code-quality problems close to the moment a file is changed, before those problems reach a deployment or review.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/data-wise/craft/hooks
Any agent
npx skills add Data-Wise/craft --skill hooks
Clone the repo
git clone --depth 1 https://github.com/Data-Wise/craft

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00042 $0.00451
Opus 5 $0.00021 $0.00226
Sonnet 5 $0.00008 $0.00090
Haiku 4.5 $0.00004 $0.00045

Measured yesterday against content hash 3b52c9b703d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hooks scanned grade A with 0 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/hooks/SKILL.md · 53 lines

What it actually says

Hook Templates

Copy any block below into .claude/settings.json under the hooks key (merge, don't replace).

MkDocs --strict hook

Catches broken internal links and Jinja template errors on every Edit/Write to a docs file. Surfaces CI failures locally before gh-deploy.

Install: merge into .claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "[ -f mkdocs.yml ] && mkdocs build --strict 2>&1 | tail -8 || true"
          }
        ]
      }
    ]
  }
}

Guard: [ -f mkdocs.yml ] makes this a no-op in non-MkDocs repos — safe to install globally.

What it catches:

  • Broken [text][ref] links and undefined [ref]: entries
  • Jinja2 template errors in mkdocs.yml or overrides/
  • Missing nav pages (paths in mkdocs.yml that don't exist on disk)

Cost: mkdocs build --strict takes ~2–5s for a medium site. Fires only on file writes, not reads.

How to add custom hooks

  1. Choose trigger: PreToolUse (before) or PostToolUse (after)
  2. Set matcher to the tool names that should trigger (pipe-separated regex: "Edit|Write")
  3. Write a shell command that exits 0 to allow, non-zero to block (PreToolUse) or flag (PostToolUse)
  4. Merge the JSON block into .claude/settings.json — don't replace existing hooks

Reference: Claude Code hooks documentation

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. yesterday First seen · 53 lines · 42 tokens per session scan A 3b52c9b703d1

Subscribe to this mod's changes

hooks is a skill published in the GitHub repository Data-Wise/craft (4 stars, last pushed 16d ago), licensed MIT. It adds 42 tokens to every session and 451 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

github-actions-workflow

Scaffolds or audits a GitHub Actions CI/CD workflow for a project. Covers job structure, caching, secrets handling, concurrency groups, environment gates, and reusable workflows via workflowcall. Invoked when the user asks to set up CI, add a GitHub Actions workflow, improve pipeline performance, or share workflow…

soulcodex/agentic · 72 tokens

specflow

Spec-driven development with executable contracts.

Hulupeep/Specflow · 9 tokens

specflow-loop-selector

Selects the correct Specflow loop and forces a concrete run contract before work starts. Use when an agent is asked to start Specflow work, build a ticket, create/refine a PRD, investigate an existing product, run Gate D, choose between spec-build and feature-build, or "go find out about" Specflow loops. Compatible…

Hulupeep/Specflow · 106 tokens

specflow-simulate

Simulates end-to-end usage of a Specflow story across multiple personas and divergent routes to discover gaps, edge cases, and unhandled branches BEFORE the story is built — then proposes each finding as a concrete story addition (new REQ, negative-path AC, Gherkin branch, or journey step). This is the high-value…

Hulupeep/Specflow · 172 tokens

specflow-audit

Audits a Specflow story/ticket for spec-compliance and surgically uplifts it — adding only the missing executable contract sections (SQL/RLS, TypeScript interfaces, invariant codes, Gherkin, acceptance criteria, Definition of Done, data-testid coverage) — then runs a pre-flight gate that refuses to mark the ticket…

Hulupeep/Specflow · 199 tokens

architecture-review

Conducts a comprehensive multi-perspective architecture review using ALL architecture team members. Use when the user requests "Start architecture review", "Full architecture review", "Review architecture for version X.Y.Z", "Conduct comprehensive review", or when they want assessment from multiple perspectives. Do…

codenamev/ai-software-architect · 80 tokens