Skills
Scope Claude Code hooks inside skill/subagent frontmatter, not just settings.json
Beyond global hooks in settings.json, Claude Code lets you define hooks directly in a skill's or subagent's frontmatter, and those hooks are scoped to that component's lifecycle — they only fire while that skill/subagent is active. This means you can attach deterministic guards (block a destructive command, enforce a lint/test, redact secrets) to a specific workflow without imposing them on every session. For builders, it's the clean way to ship a self-contained skill that carries its own safety rails instead of relying on the model to remember instructions or on a bloated global hook config.
↳ Follow the thread