CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

claude-code-hooks

Explains Claude Code hook events, exit-code contracts, and practical patterns for building guards, injectors, and human-confirmation gates. Provides detailed guidance on parsing, failure handling, loop termination, testing, deployment, profile registration, and real-command replay, with examples and references for further implementation detail.

Quality

84%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

SKILL.md
Quality
Evals
Security

Quality

Content

62%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The body contains exceptional, hard-won operational knowledge with exemplary validation discipline and a verified, well-organized reference bundle, but it is delivered at roughly 5–10x a reasonable token budget. The 25k-token loaded-at-trigger surface buries an anchor-5 workflow inside narrative padding that the skill's own maintenance policy would place in references.

Suggestions

Apply the file's own maintenance policy retroactively: move the dated incident narratives and war stories (e.g. the 2026-07-22 false-block anatomy, the 2026-08-06 replay story, the 2026-10-04 fleet-stall measurement) to references/hook_pitfalls.md, leaving one-line symptom pointers — this alone would cut the body well under half its size.

State each contract point once and cross-reference it: the 8-block ceiling counter-reset caveat, the prose-vs-enforcement motif, and the Stop-is-the-odd-one-out argument each appear three or more times; keep the canonical statement in its rule and reference it elsewhere.

Move full worked examples that are not contract-level rules out of the main file — the filled Loop Contract example, the ShellCheck 0.11.0 evaluation, and the maintenance meta-history section — to references, keeping only the templates and pointers in SKILL.md.

DimensionReasoningScore

Conciseness

The 1,424-line (~100KB) body is heavily padded: dated war stories (2026-07-05 through 2026-10-04), a maintenance section recounting the file's own 10k→50k growth, and the same caveats repeated many times (the 8-block ceiling counter-reset point appears in the hook-types table, rule 7 mechanism 1, and rule 7's termination section). It also pedagogically explains concepts Claude already knows (loop variants with a Wikipedia link, hysteresis, bash quote-splicing, set -e semantics), though most of the operational knowledge is genuinely novel — so it is noticeably-to-severely verbose rather than the pure basic-concept padding of the score-1 anchor.

2 / 5

Actionability

Concrete, executable guidance dominates: a runnable PreToolUse bash skeleton, copy-paste gate commands (`bash -n hook.sh`, printf JSON-event pipes with expected exits), receipt-key and session-counter snippets with BSD/GNU stat variants, and a shipped test harness (scripts/test_hook.sh, verified present). It falls short of anchor 5 only because the central skeleton carries explicit placeholders (`if <command actually does the banned thing>`, TRIGGER) and the complete implementations (Pattern A, the shlex walker) live one level away in references/hook_patterns.md — a justified template split, but still a gap.

4 / 5

Workflow Clarity

The 'Build order (in sequence)' section is a numbered 9-step process with explicit validation checkpoints at every step: trigger AND healthy-lookalike cases before registering ('Do not register until green'), bash -n + test_hook.sh gates, corpus replay with hand-checked blocks, and fresh-native-session verification. Feedback loops (validate → fix → re-validate, replay → fix list → re-replay), checklists (the Loop Contract template, the Q1–Q4 termination checklist), and after-remediation row pairs are all explicit — matching anchor 5, including for the destructive/batch operations the cap targets.

5 / 5

Progressive Disclosure

The bundle structure itself is strong: all 5 references/ and 2 scripts/ files exist, every deep link resolves (hook_pitfalls #36/#44/#45/#68/#73/#74, hook_patterns walker and shipped-gate anchors, shared-engine-lifecycle consumers heading, AFTER-REMEDIATION rows in test_hook.sh), references are one level deep and clearly signaled with per-file descriptions. But the core principle — a lean loaded-at-trigger overview — is badly violated: 1,000+ lines of incident narrative, war stories, and rule essays that the file's own maintenance policy says belong in references/hook_pitfalls.md are inlined in SKILL.md, so content that should be separate is inline despite good signaling.

3 / 5

Total

14

/

20

Passed

Description

100%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

The description is exemplary: third-person voice, concrete lifecycle verbs, named hook types, an explicit use-when clause with natural trigger phrases in two languages, and a distinctive enforcement niche. It hits the anchor-5 example on every dimension with no padding.

DimensionReasoningScore

Specificity

"Writes, tests, registers and debugs Claude Code hooks (PreToolUse, PostToolUse, SessionStart, Stop)" lists four concrete lifecycle actions plus four named hook types, and "turn a rule the model keeps breaking into a hard gate" states the outcome — comprehensive concrete coverage with no visible gaps, matching anchor 5 rather than anchor 4's 'minor gaps'.

5 / 5

Completeness

Both halves are explicit: a clear third-person 'what' (writes/tests/registers/debugs hooks that enforce a recurring rule) and an explicit 'Use when...' clause with concrete trigger phrases including a quoted user utterance — exactly anchor 5's 'clearly and explicitly answers both what AND when'.

5 / 5

Trigger Term Quality

Natural trigger phrasing is comprehensive: "block or intercept a tool call", "add a guard rail", "fix a misfiring hook", bilingual synonyms (拦截 / 守卫 / 钩子), and the verbatim colloquialism "make it stop doing X" — covering synonyms across languages the way anchor 5's example covers 'PDF files, PDFs, .pdf'.

5 / 5

Distinctiveness Conflict Risk

"Claude Code hooks (PreToolUse, PostToolUse, SessionStart, Stop)" plus the enforcement framing (block / intercept / guard rail / misfiring) carves a clear niche with triggers that would not plausibly route to another skill; overlap risk with a generic settings/configuration skill is minimal, fitting anchor 5.

5 / 5

Total

20

/

20

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

skill_md_line_count

SKILL.md is long (1425 lines); consider splitting into references/ and linking

Warning

Total

15

/

16

Passed

Repository

daymade/claude-code-skills

Path

daymade-claude-code/claude-code-hooks/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.