hook-scope-guide
SolidSelect hook scope (plugin, project, global) by audience. Use when authoring a hook.
Code & Development 310 stars
27 forks Updated today MIT
Install
Quality Score: 88/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Hook Scope Decision Guide
This skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.
## Important: Auto-Loading Behavior
> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.
> Do NOT add `"hooks": "./hooks/hooks.json"` to your `plugin.json` - this causes duplicate load errors.
> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.
## The Three Scopes
| Scope | Location | Audience | Committed? | Persistence |
|-------|----------|----------|------------|-------------|
| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |
| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |
| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |
## Decision Framework
### Question 1: Who needs this hook?
**Only plugin users** → Plugin hooks
- Hook is part of plugin's core functionality
- Users expect it when they enable your plugin
- Example: A YAML plugin validates YAML syntax on edit
**All team members on this project** → Project hooks
- Codebase-specific rules or protections
- Team conventions that should be enforced
- Example: Block modifications to `/src/production/` configs
**Only me, everywhere** → Global hooks
- Personal preferences or workflow optimizations
- Cross-project utilities like logging
- Example: Log all ba...
Details
- Author
- athola
- Repository
- athola/claude-night-market
- Created
- 6 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Solid
hook-authoring
Guide creating Claude Code hooks with security-first design. Use for validation and enforcement.
310 Updated today
athola AI & Automation Listed
hook
Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
364 Updated today
aiskillstore AI & Automation Listed
writing-hooks
How to write Claude Code hooks -- event selection, hook types, matcher patterns, blocking vs advisory, portable paths. Use when creating hooks for quality gates, automation, or policy enforcement.
77 Updated today
xiaolai