Answer: Save the plugin's hooks in `hooks/hooks.json` at the plugin root, under a top-level `"hooks"` key, in the same shape as the `hooks` object in `settings.json`. A plugin's hooks don't wait for one of the plugin's skills or commands to be used; Claude Code registers them when a session loads the plugin, and they fire on their events from then on. Status: Confirmed Entry: tool/claude-code/agents-and-automation/add-hooks-to-plugin Revision: 2 Digest: sha256:673cabf7d25ff112 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:59Z Last changed: 2026-11-14T12:18:41Z (example hook event: — → PostToolUse) Last verified: 2026-11-20T12:22:57Z Next check: 2026-11-21T12:22:57Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of hooks file location | hooks/hooks.json | [1] | 2026-11-20 when plugin hooks fire | Claude Code registers them when a session loads the plugin, and they fire on their events from then on | [1] | 2026-11-20 example hook event | PostToolUse | [1] | 2026-11-20 example matcher | Write|Edit | [1] | 2026-11-20 example script path | scripts/format.sh | [1] | 2026-11-20 Sources: [1] Anthropic. "Add components to a plugin". https://code.claude.com/docs/en/plugins/components.md Role: primary. Accessed: 2026-11-20T12:22:57Z Quote: "Save the plugin's hooks in `hooks/hooks.json` at the plugin root, under a top-level `"hooks"` key" (Supports: hooks file location) Quote: "Claude Code registers them when a session loads the plugin, and they fire on their events from then on." (Supports: when plugin hooks fire) Quote: ""PostToolUse": [" (Supports: example hook event) Quote: ""matcher": "Write|Edit"," (Supports: example matcher) Quote: "Save the script at `scripts/format.sh` and make it executable." (Supports: example script path) Published: 2026-11-20T02:52:52Z Snapshot SHA-256: 1ea4367112bf1ab73bd954ed6ee6bebb411d4a4dde3081f89bed44ba55a21a04 (captured 2026-11-13T12:12:25Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T12:12:25Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:22:57Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:22:57Z Last attempt: 2026-11-20T12:22:57Z Notes and limitations: Extracted automatically from a single official source (section "Hooks"). Related: https://latestn.com/tool/claude-code/agents-and-automation/add-skill-to-plugin How do I add a skill to a Claude Code plugin? https://latestn.com/tool/claude-code/agents-and-automation/agent-sdk-capabilities What is the Claude Code Agent SDK and what can it do? https://latestn.com/tool/claude-code/agents-and-automation/agent-sdk-demo-applications Where can I find Claude Code Agent SDK demo applications I can clone? https://latestn.com/tool/claude-code/admin-and-enterprise/wsl-managed-devices How do I use Claude Code Desktop in WSL on a managed device? https://latestn.com/tool/claude-code/agents-and-automation/add-api-trigger How do I add an API trigger to a Claude Code scheduled task? https://latestn.com/tool/claude-code/agents-and-automation/add-command-or-tool-mod How do I add a command or tool to a Claude Code mod using the mods API? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-14T12:18:41Z | changed | example hook event: — → PostToolUse | [1] 2026-11-14T12:18:41Z | changed | when plugin hooks fire: — → Claude Code registers them when a session loads the plugin, and they fire on their events from then on | [1] 2026-11-14T12:18:41Z | changed | example event: PostToolUse → — | [1] 2026-11-14T12:18:41Z | changed | when hooks fire: Claude Code registers them when a session loads the plugin, and they fire on their events from then on → — | [1] 2026-11-14T12:18:41Z | changed | top-level key: "hooks" → — | [1] 2026-11-13T03:04:59Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/add-hooks-to-plugin/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/add-hooks-to-plugin POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/add-hooks-to-plugin with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/add-hooks-to-plugin?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I add hooks to a Claude Code plugin and when do plugin hooks fire? Revision 2, last verified 2026-11-20T12:22:57Z. https://latestn.com/tool/claude-code/agents-and-automation/add-hooks-to-plugin (accessed 2026-11-21T10:02:28Z). @misc{LatestN_tool_claude_code_agents_and_automation_add_hooks_to_plugin_r2, title = {How do I add hooks to a Claude Code plugin and when do plugin hooks fire?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/add-hooks-to-plugin}}, note = {Revision 2; digest sha256:673cabf7d25ff112; last verified 2026-11-20T12:22:57Z; accessed 2026-11-21T10:02:28Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/add-hooks-to-plugin