> **Hook Development** — chapter 6 of 10 in [anthropics/claude-code](https://skillsdocs.com/anthropics/claude-code).
>
> Book (all chapters, one file): https://skillsdocs.com/anthropics/claude-code.md
> Machine manifest: https://skillsdocs.com/anthropics/claude-code/.well-known/agent-skills/index.json
> Install the book: `npx skills add anthropics/claude-code`
> Upstream: https://github.com/anthropics/claude-code/blob/main/plugins/plugin-dev/skills/hook-development/SKILL.md @ `main`
> Raw bytes, no header: https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/SKILL.md
> Base for relative paths: https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/
> Licence: No licence detected — all rights reserved by its authors
>
> Bundled files (10), referenced from this skill's directory:
>   - `examples/load-context.sh` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/examples/load-context.sh
>   - `examples/validate-bash.sh` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/examples/validate-bash.sh
>   - `examples/validate-write.sh` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/examples/validate-write.sh
>   - `references/advanced.md` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/references/advanced.md
>   - `references/migration.md` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/references/migration.md
>   - `references/patterns.md` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/references/patterns.md
>   - `scripts/hook-linter.sh` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/scripts/hook-linter.sh
>   - `scripts/README.md` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/scripts/README.md
>   - `scripts/test-hook.sh` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/scripts/test-hook.sh
>   - `scripts/validate-hook-schema.sh` — https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh
>
> Content © its authors. This chapter's body is not served here; the links above are. Takedown: https://github.com/DreambaseAI/skillsdocs/issues/new?labels=takedown&title=Takedown+request

# Hook Development

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

No licence could be detected for this skill at either the repository or the skill level, so its body is not reproduced here. Read it upstream:

https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/plugin-dev/skills/hook-development/SKILL.md
