dbatools: Skill for Claude Code

.claude/skills/hooks-doctor/SKILL.md

hooks-doctor is a skill for Claude Code from dataplat/dbatools. It costs 45 tokens per session (405 once invoked), scanned A, original, MIT.

A diagnostic guide for the automated checks, or hooks, used by this repository during coding sessions. It explains how to inspect installed tools, understand missing protections, and troubleshoot hook errors.

In plain words
What is it for?
Use it when repository hooks do nothing, report errors, or unexpectedly block changes.
Why use it?
It shows why a check may be absent or failing and gives the appropriate way to restore it without confusing a missing tool with a code problem.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

This is dataplat/dbatools's own configuration. It tells Claude Code how to work on dbatools itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dbatools configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash .claude/hooks/hooks-doctor.sh.

About the project

dbatools is a PowerShell toolkit for automating SQL Server administration and moving SQL Server instances between environments. It is for database administrators who manage SQL Server systems and migrations.

dataplat/dbatools · 2,829 stars · on GitHub · dbatools.io

Reuse

Borrowing it

Nothing to install: this file belongs to dataplat/dbatools. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dataplat/dbatools/development/.claude/skills/hooks-doctor/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/dataplat/dbatools

Made for: Claude Code.

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 hooks-doctor

README.md
[![agentmods](https://agentmods.dev/badge/skills/dataplat/dbatools/hooks-doctor.svg)](https://agentmods.dev/skills/dataplat/dbatools/hooks-doctor)
Your own site
<a href="https://agentmods.dev/skills/dataplat/dbatools/hooks-doctor"><img src="https://agentmods.dev/badge/skills/dataplat/dbatools/hooks-doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 405 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00045 $0.00405
Opus 5 $0.00023 $0.00202
Sonnet 5 $0.00009 $0.00081
Haiku 4.5 $0.00005 $0.00040

Measured 3d ago against content hash 2112b5a650d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

hooks-doctor 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 3d 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.

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.

.claude/skills/hooks-doctor/SKILL.md · 28 lines

What it actually says

Hooks Doctor

Run the diagnostic and interpret it for the user:

bash .claude/hooks/hooks-doctor.sh

Present the results conversationally:

  1. All OK — say the hook environment is fully functional and list the active gates (style validation, read-before-edit, destructive-command guard, registration/TODO/verify Stop gates, codex auto-review).
  2. Something MISSING — explain what that specific absence disables (the script prints it) and give the one-line install fix. Every hook fails open, so a missing tool never breaks the session — it just silently removes that protection.
  3. Hook errors in the transcript — if the user reports hook error messages, check:
    • Hook paths in .claude/settings.json must use "$CLAUDE_PROJECT_DIR" (hooks run in the session cwd, not the repo root — relative paths break)
    • Line endings: hook scripts must be LF (enforced via .gitattributes); CRLF causes bad interpreter on Linux
    • claude --debug hooks records each hook's exit code and stderr
  4. User wants to opt out — per-developer opt-outs, in increasing scope:
    • CLAUDE_CODEX_REVIEW=off / CLAUDE_STOP_VERIFY=off (env, per session)
    • STOP_GUARD_MAX_BLOCKS=1 to shrink blocking budgets
    • .claude/settings.local.json with {"disableAllHooks": true} (gitignored, personal)

Never suggest editing the checked-in .claude/settings.json to opt out — that changes the gates for every developer.

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. 3d ago First seen · 28 lines · 45 tokens per session scan A 2112b5a650d0

Subscribe to this mod's changes

hooks-doctor is a skill published in the GitHub repository dataplat/dbatools (2,829 stars, last pushed 3d ago), licensed MIT. It adds 45 tokens to every session and 405 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-09-03.

Related

Other skills, from other repositories

material-ui-nextjs

Integrates Material UI with Next.js App and Pages routers using @mui/material-nextjs, Emotion cache providers, next/font, CSS layers with Tailwind/CSS Modules, Link component prop patterns, CSS theme variables SSR notes, and App Router useSearchParams + Suspense. Use when setting up or debugging MUI in a Next.js app.

mui/material-ui · 76 tokens

conventional-commit

Workflow for generating conventional commit messages following the Conventional Commits specification. MUST be invoked every time a commit is created. Guides construction of standardized commit messages with correct type, scope, description, body, and footer.

JanDeDobbeleer/oh-my-posh · 47 tokens

RootCauseAnalysis

Structured incident investigation using Five Whys, Fishbone, blameless Postmortem, Fault Tree, Kepner-Tregoe, and FMEA — traces failures to systemic root causes rather than blaming humans. USE WHEN root cause, RCA, 5 whys, fishbone, postmortem, incident analysis, fault tree, why does this keep failing, blameless…

danielmiessler/LifeOS · 93 tokens

oh-my-posh

Install, configure, or troubleshoot Oh My Posh/ohmyposh: shell init, themes, segments, Nerd Font icons, and prompt setup on PowerShell, zsh, bash, or fish.

JanDeDobbeleer/oh-my-posh · 47 tokens

Vitals

Read-only macOS performance inspection: a deterministic CLI gathers the numbers, Interpretation.md turns them into a diagnosis instead of a data dump.

danielmiessler/LifeOS · 179 tokens

benchmark-workflow

Run, diagnose, or change Xberg extraction benchmarks, quality scoring, benchmark fixtures, artifact contracts, and independently sourced ground truth. Load for the Benchmarks workflow or benchmark-harness work, not ordinary unit tests.

xberg-io/xberg · 47 tokens