{"id":"6b20e91d-87bc-44ae-80a5-3824fadc8c19","entityType":"agent","slug":"clawhub-athola-nm-abstract-hook-scope-guide","name":"hook-scope-guide","canonicalUrl":"https://www.xpersona.co/agent/clawhub-athola-nm-abstract-hook-scope-guide","canonicalPath":"/agent/clawhub-athola-nm-abstract-hook-scope-guide","generatedAt":"2026-10-11T00:32:44.808Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T21:52:24.730Z","emptyReason":null},"description":"Select hook scope (plugin, project, global) by audience Skill: hook-scope-guide Owner: athola Summary: Select hook scope (plugin, project, global) by audience Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:03:03.222Z | user Release v1.9.19 v1.9.18 | 2026-08-15T21:27:36.044Z | user Release v1.9.18 v1.9.17 | 2026-07-30T05:27:31.047Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:44:25.965Z | user Release v1.9.16 v1.9.15 | 2026-07-04T21:19:04.853Z | user Releas","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-abstract-hook-scope-guide","sourceUrl":"https://clawhub.ai/athola/nm-abstract-hook-scope-guide","homepage":"https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/athola/nm-abstract-hook-scope-guide","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Select hook scope (plugin, project, global) by audience Skill: hook-scope-guide Owner: athola Summary: Select hook scope (plugin, project, global) by audience T"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:52:24.730Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:52:24.730Z","emptyReason":null},"stars":null,"forks":null,"downloads":1249,"packageName":null,"latestVersion":"1.9.19","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:52:24.664Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T21:52:24.730Z","lastCrawledAt":"2026-10-10T21:52:24.664Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T21:52:24.664Z","lastVerifiedAt":null,"highlights":[{"version":"1.9.19","createdAt":"2026-08-26T13:03:03.222Z","changelog":"Release v1.9.19","fileCount":3,"zipByteSize":4959},{"version":"1.9.18","createdAt":"2026-08-15T21:27:36.044Z","changelog":"Release v1.9.18","fileCount":3,"zipByteSize":5051},{"version":"1.9.17","createdAt":"2026-07-30T05:27:31.047Z","changelog":"Release v1.9.17","fileCount":3,"zipByteSize":4907},{"version":"1.9.16","createdAt":"2026-07-14T19:44:25.965Z","changelog":"Release v1.9.16","fileCount":3,"zipByteSize":4895},{"version":"1.9.15","createdAt":"2026-07-04T21:19:04.853Z","changelog":"Release v1.9.15","fileCount":3,"zipByteSize":4966},{"version":"1.9.14","createdAt":"2026-06-30T17:49:39.397Z","changelog":"Release v1.9.14","fileCount":3,"zipByteSize":5045},{"version":"1.9.13","createdAt":"2026-06-27T16:14:17.608Z","changelog":"Release v1.9.13","fileCount":3,"zipByteSize":4948},{"version":"1.9.12","createdAt":"2026-06-19T03:07:22.539Z","changelog":"Release v1.9.12","fileCount":3,"zipByteSize":4984}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-abstract-hook-scope-guide","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T00:32:44.805Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T21:52:24.730Z","emptyReason":null},"readme":"Skill: hook-scope-guide\n\nOwner: athola\n\nSummary: Select hook scope (plugin, project, global) by audience\n\nTags: latest:1.9.19\n\nVersion history:\n\nv1.9.19 | 2026-08-26T13:03:03.222Z | user\n\nRelease v1.9.19\n\nv1.9.18 | 2026-08-15T21:27:36.044Z | user\n\nRelease v1.9.18\n\nv1.9.17 | 2026-07-30T05:27:31.047Z | user\n\nRelease v1.9.17\n\nv1.9.16 | 2026-07-14T19:44:25.965Z | user\n\nRelease v1.9.16\n\nv1.9.15 | 2026-07-04T21:19:04.853Z | user\n\nRelease v1.9.15\n\nv1.9.14 | 2026-06-30T17:49:39.397Z | user\n\nRelease v1.9.14\n\nv1.9.13 | 2026-06-27T16:14:17.608Z | user\n\nRelease v1.9.13\n\nv1.9.12 | 2026-06-19T03:07:22.539Z | user\n\nRelease v1.9.12\n\nv1.0.0 | 2026-06-07T21:21:34.582Z | auto\n\n- Initial release of the hook scope decision guide.\n- Explains plugin, project, and global scopes for Claude Code hooks with examples and configuration details.\n- Describes scope selection logic for audience, persistence, and version control needs.\n- Documents loading order and hook precedence.\n- Lists security considerations and common patterns for each scope.\n- Includes info on SessionStart hook enhancements (Claude Code 2.1.2+).\n\nArchive index:\n\nArchive v1.9.19: 3 files, 4959 bytes\n\nFiles: skill-card.md (1992b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.19:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.19:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.19\",\n  \"publishedAt\": 1787749383222\n}\n\nFile v1.9.19:skill-card.md\n\n## Description:\n\nSelect hook scope (plugin, project, global) by audience.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and plugin authors use this skill to choose whether Claude Code hooks belong in plugin, project, or global settings based on audience, version-control needs, and persistence.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Hook examples can execute commands if copied into active Claude Code settings, especially global hooks that run in every session.\n\nMitigation: Review and test hook examples before installing them, and prefer the narrowest scope that matches the intended audience.\n\nRisk: Adding an explicit hooks entry for the standard plugin hook file can create duplicate loading errors.\n\nMitigation: Rely on the standard automatic loading behavior for hooks/hooks.json and only configure additional hook files explicitly.\n\n## Reference(s):\n\n- [Claude Night Market abstract plugin](https://github.com/athola/claude-night-market/tree/master/plugins/abstract)\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, markdown, code, configuration]\n\n**Output Format:** [Markdown guidance with JSON, shell, and Python examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Documentation-only; does not install or execute hooks automatically.]\n\n## Skill Version(s):\n\n1.9.19 (source: release metadata; artifact frontmatter lists 1.9.8)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.9.18: 3 files, 5051 bytes\n\nFiles: skill-card.md (2231b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.18:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.18:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.18\",\n  \"publishedAt\": 1786829256044\n}\n\nFile v1.9.18:skill-card.md\n\n## Description:\n\nSelect hook scope (plugin, project, global) by audience.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and plugin authors use this skill to decide whether Claude Code hooks belong in plugin, project, or global configuration based on audience, version-control expectations, and persistence needs.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sample logging hooks can capture raw tool input and expose sensitive project or user data.\n\nMitigation: Log only timestamps, tool names, or redacted summaries, and keep any local logs protected with appropriate file permissions.\n\nRisk: Global hooks can affect every Claude Code session for the user.\n\nMitigation: Use global hooks only when cross-session behavior is intentional, and test them before relying on them broadly.\n\nRisk: Adding a standard plugin hook file again through plugin configuration can create duplicate hook loading.\n\nMitigation: Let Claude Code auto-load the standard hooks/hooks.json file and reserve explicit hook configuration for additional hook files.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide)\n- [claude-night-market abstract plugin](https://github.com/athola/claude-night-market/tree/master/plugins/abstract)\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with JSON, shell, and Python snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [None]\n\n## Skill Version(s):\n\n1.9.18 (source: server release metadata; artifact frontmatter lists 1.9.8)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.9.17: 3 files, 4907 bytes\n\nFiles: skill-card.md (1956b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.17:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.17:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.17\",\n  \"publishedAt\": 1785389251047\n}\n\nFile v1.9.17:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and plugin authors use this skill to choose whether Claude Code hooks belong at plugin, project, or global scope based on audience, persistence, and version-control needs. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Logging hook examples can capture secrets, proprietary code, prompts, or sensitive file paths if copied without review. <br>\nMitigation: Redact sensitive values, log only the minimum necessary fields, restrict log file permissions, and define retention limits before enabling logging hooks. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide) <br>\n- [OpenClaw homepage](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code hooks documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code settings configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with JSON configuration examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Includes scope-selection criteria, hook configuration examples, and security considerations.] <br>\n\n## Skill Version(s): <br>\n1.9.17 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.16: 3 files, 4895 bytes\n\nFiles: skill-card.md (1930b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.16:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.16:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.16\",\n  \"publishedAt\": 1784058265965\n}\n\nFile v1.9.16:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to choose whether Claude Code hooks belong at plugin, project, or global scope based on audience, persistence, and version-control needs. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Global hooks can affect all Claude Code sessions when a reader applies the guidance manually. <br>\nMitigation: Review the intended scope before adding a hook, test global hooks carefully, and prefer plugin or project scope when the behavior should be limited. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide) <br>\n- [Claude Night Market Abstract Plugin](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, markdown, configuration, code] <br>\n**Output Format:** [Markdown guidance with JSON, shell, and Python examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Documentation-only guidance; no hooks are installed or executed by the skill.] <br>\n\n## Skill Version(s): <br>\n1.9.16 (source: ClawHub release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.15: 3 files, 4966 bytes\n\nFiles: skill-card.md (2115b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.15:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.15:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.15\",\n  \"publishedAt\": 1783199944853\n}\n\nFile v1.9.15:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and plugin authors use this skill to decide whether Claude Code hooks belong in plugin, project, or global configuration based on audience, version-control needs, and persistence. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Copied hook examples can log full tool inputs, prompts, file contents, or secrets. <br>\nMitigation: Redact sensitive values and avoid logging complete Claude tool input or prompt content. <br>\nRisk: Global hooks can run across all Claude sessions with the user's local credentials. <br>\nMitigation: Prefer plugin or project scope when possible, and review global hooks carefully before enabling them. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide) <br>\n- [Publisher profile](https://clawhub.ai/user/athola) <br>\n- [Project homepage](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, markdown, configuration, code, shell commands] <br>\n**Output Format:** [Markdown guidance with JSON, shell, and Python examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Documentation-only; it does not install or run hooks.] <br>\n\n## Skill Version(s): <br>\n1.9.15 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.14: 3 files, 5045 bytes\n\nFiles: skill-card.md (2281b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.14:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.14:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.14\",\n  \"publishedAt\": 1782841779397\n}\n\nFile v1.9.14:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and skill authors use this reference guide to choose whether a Claude Code hook belongs at plugin, project, or global scope based on audience, persistence, and governance needs. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Logging hook examples can capture raw tool inputs, credentials, source code, or personal data if copied without narrowing scope. <br>\nMitigation: Review and minimize logged fields before use, avoid sensitive data by default, and keep global hooks narrow because they apply across all Claude Code sessions. <br>\nRisk: Global hooks can affect every Claude Code session for the user account. <br>\nMitigation: Prefer plugin or project scope when the behavior is tied to a plugin or team repository, and test global hooks before relying on them. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide) <br>\n- [OpenClaw homepage metadata](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code hooks documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code settings configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Markdown, Code, Configuration] <br>\n**Output Format:** [Markdown guidance with JSON, shell, and Python examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Documentation-only output; examples must be copied intentionally before they affect a Claude Code environment.] <br>\n\n## Skill Version(s): <br>\n1.9.14 (source: server release evidence; artifact frontmatter reports 1.9.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.13: 3 files, 4948 bytes\n\nFiles: skill-card.md (2034b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.13:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.13:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.13\",\n  \"publishedAt\": 1782576857608\n}\n\nFile v1.9.13:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and teams use this skill to decide whether Claude Code hooks belong in a plugin, a shared project configuration, or a personal global configuration. It helps authors account for audience, version control, persistence, and hook security implications. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Hook examples that write logs, read tool input, or apply globally can run with the user's account permissions across projects if copied without review. <br>\nMitigation: Review each hook before use, prefer the narrowest appropriate scope, and test global hooks carefully before enabling them broadly. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/athola/skills/nm-abstract-hook-scope-guide) <br>\n- [OpenClaw Homepage](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Markdown, Configuration] <br>\n**Output Format:** [Markdown guidance with JSON configuration examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Documentation-only guidance; no tool calls or commands are executed by the skill itself.] <br>\n\n## Skill Version(s): <br>\n1.9.13 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.12: 3 files, 4984 bytes\n\nFiles: skill-card.md (2216b), SKILL.md (8494b), _meta.json (148b)\n\nFile v1.9.12:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.9.12:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.12\",\n  \"publishedAt\": 1781838442539\n}\n\nFile v1.9.12:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and plugin authors use this skill to decide whether Claude Code hooks belong in plugin, project, or global configuration based on audience, version-control needs, and persistence. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Hook configurations can execute commands or apply beyond the intended audience when scoped too broadly. <br>\nMitigation: Review the chosen scope, prefer project settings for team rules, and test global hooks before enabling them. <br>\nRisk: Examples may involve local file access or command execution in Claude Code settings. <br>\nMitigation: Review proposed hook commands and required permissions before adding them to plugin, project, or user configuration. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/nm-abstract-hook-scope-guide) <br>\n- [Publisher profile](https://clawhub.ai/user/athola) <br>\n- [OpenClaw homepage](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, markdown, code, configuration] <br>\n**Output Format:** [Markdown guidance with JSON and Python code examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Provides decision criteria and examples for plugin, project, and global hook scopes.] <br>\n\n## Skill Version(s): <br>\n1.9.12 (source: server release evidence; artifact frontmatter reports 1.9.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.0: 3 files, 4965 bytes\n\nFiles: skill-card.md (2162b), SKILL.md (8494b), _meta.json (147b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}\n```\n\n> **Note**: Use string matchers (`\"Read\"`) not object matchers (`{\"toolName\": \"Read\"}`).\n\n**Key features**:\n- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths\n- Auto-merges when plugin is enabled\n- Deactivates when plugin is disabled\n\n**Examples**:\n- Validation hook for a linting plugin\n- Auto-formatting hook for a code style plugin\n- Logging hook for a debugging plugin\n\n### Project Hooks\n\n**Location**: `.claude/settings.json` (in project root)\n\n**When to use**:\n- Enforcing team-wide policies\n- Protecting project-specific resources\n- Codebase conventions that should survive across team members\n- Rules that should be reviewed in PRs\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n> **Note**: Use string matchers (`\"Bash\"`) not object matchers.\n\n**Key features**:\n- Committed to version control\n- Shared across all team members\n- Changes are visible in PRs (governance trail)\n- Project-specific, not personal\n\n**Examples**:\n- Block modifications to production configs\n- Require test commands before completion\n- Warn about editing sensitive directories\n- Enforce project naming conventions\n\n### Global Hooks\n\n**Location**: `~/.claude/settings.json`\n\n**When to use**:\n- Personal workflow preferences\n- Cross-project utilities\n- Organization-wide compliance you want everywhere\n- Private rules that shouldn't be shared\n\n**Configuration**:\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n**Key features**:\n- Never committed to any repo\n- Applies to ALL Claude Code sessions\n- Personal to your user account\n- Survives across projects\n\n**Examples**:\n- Personal audit logging\n- Cross-project safety rules\n- Custom notification integrations\n- Development environment preferences\n\n## Loading Order & Precedence\n\nClaude Code loads settings in this priority (highest first):\n\n1. **Enterprise policies** (organization-managed)\n2. **Command-line arguments** (`claude --flag`)\n3. **Local project settings** (`.claude/settings.local.json`)\n4. **Shared project settings** (`.claude/settings.json`)\n5. **User settings** (`~/.claude/settings.json`)\n\n**Important**: Multiple hooks from different scopes can respond to the same event. When they do, **all matching hooks execute in parallel**.\n\n## Quick Reference: Scope Selection\n\n```\nIs this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all\n```\n\n## Security Considerations\n\n**Plugin hooks**:\n- Audited as part of plugin installation\n- Users consent when enabling plugin\n- Scope limited to plugin's purpose\n\n**Project hooks**:\n- Visible to all team members\n- Changes reviewed in PRs\n- Should reflect team consensus\n\n**Global hooks**:\n- Execute with your credentials everywhere\n- Can affect all projects unexpectedly\n- Review security implications carefully\n- Test thoroughly before adding\n\n## Common Patterns by Scope\n\n### Plugin Hook Patterns\n- **Validation**: Check files match plugin's format\n- **Auto-completion**: Suggest plugin-specific completions\n- **Logging**: Track plugin-specific operations\n\n### Project Hook Patterns\n- **Protection**: Block dangerous operations on sensitive paths\n- **Enforcement**: Require tests, linting, or builds\n- **Conventions**: Warn about style or naming violations\n\n### Global Hook Patterns\n- **Auditing**: Log all operations for personal review\n- **Safety**: Universal dangerous command detection\n- **Integration**: Personal tool notifications\n\n## SessionStart Hook Enhancements (Claude Code 2.1.2+)\n\nSessionStart hooks now receive additional input fields via stdin:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Unique session identifier |\n| `source` | enum | `\"startup\"` \\| `\"resume\"` \\| `\"clear\"` \\| `\"compact\"` |\n| `agent_type` | string | Agent name if `--agent` flag used, empty otherwise |\n\n### Agent-Aware Hooks\n\nThe `agent_type` field enables scope-appropriate context injection:\n\n```python\n# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))\n```\n\nThis is particularly useful for:\n- **Plugin hooks**: Reduce overhead for lightweight agents\n- **Project hooks**: Skip governance for review-only agents\n- **Global hooks**: Customize logging verbosity per agent\n\n## Related Skills\n\n- **abstract:hook-authoring** - For hook rule syntax and patterns\n- **abstract:validate-plugin** - For validating plugin structure including hooks\n\n## References\n\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1780867294582\n}\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nSelect hook scope (plugin, project, global) by audience. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and skill authors use this guide to decide whether Claude Code hooks belong in plugin, project, or global scope based on audience, version-control, and persistence needs. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The trigger phrase is broad and may activate outside a focused hook-scope decision task. <br>\nMitigation: Use the guidance when deciding hook placement, then verify the recommendation against the actual audience, persistence, and version-control requirements. <br>\nRisk: Project and global hook examples can run commands with user credentials and may persist across projects. <br>\nMitigation: Review hook commands and scope before adding them to Claude Code settings, especially for project or global hooks. <br>\n\n\n## Reference(s): <br>\n- [ClawHub release page](https://clawhub.ai/athola/nm-abstract-hook-scope-guide) <br>\n- [claude-night-market abstract plugin](https://github.com/athola/claude-night-market/tree/master/plugins/abstract) <br>\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks) <br>\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, markdown, code, shell commands, configuration] <br>\n**Output Format:** [Markdown with JSON, Bash, and Python examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Documentation-only; examples require user review before adoption.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>","readmeExcerpt":"Skill: hook-scope-guide Owner: athola Summary: Select hook scope (plugin, project, global) by audience Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:03:03.222Z | user Release v1.9.19 v1.9.18 | 2026-08-15T21:27:36.044Z | user Release v1.9.18 v1.9.17 | 2026-07-30T05:27:31.047Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:44:25.965Z | user Release v1.9.16 v1.9.15 | 2026-07-04T21:19:04.853Z | user Releas","codeSnippets":[],"executableExamples":[{"language":"json","snippet":"{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}"},{"language":"json","snippet":"{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"if [[ \\\"$CLAUDE_TOOL_INPUT\\\" == *\\\"production\\\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi\"\n        }]\n      }\n    ]\n  }\n}"},{"language":"json","snippet":"{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"echo \\\"$(date): $CLAUDE_TOOL_NAME\\\" >> ~/.claude/audit.log\"\n        }]\n      }\n    ]\n  }\n}"},{"language":"text","snippet":"Is this hook part of a plugin's core functionality?\n├─ YES → Plugin hooks (hooks/hooks.json in plugin)\n└─ NO ↓\n\nShould all team members on this project have this hook?\n├─ YES → Project hooks (.claude/settings.json)\n└─ NO ↓\n\nShould this hook apply to all my Claude sessions?\n├─ YES → Global hooks (~/.claude/settings.json)\n└─ NO → Reconsider if you need a hook at all"},{"language":"python","snippet":"# Skip heavy context for review agents\ninput_data = json.loads(sys.stdin.read())\nif input_data.get(\"agent_type\") in [\"code-reviewer\", \"quick-query\"]:\n    print(json.dumps({\"hookSpecificOutput\": {\"additionalContext\": \"Minimal\"}}))"},{"language":"json","snippet":"{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAUDE_PLUGIN_ROOT}/log.txt\"\n      }]\n    }\n  ]\n}"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: hook-scope-guide\ndescription: Select hook scope (plugin, project, global) by audience\nversion: 1.9.8\ntriggers:\n  - authoring a hook\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/abstract\", \"emoji\": \"\\ud83e\\udd9e\"}}\nsource: claude-night-market\nsource_plugin: abstract\n---\n\n> **Night Market Skill** — ported from [claude-night-market/abstract](https://github.com/athola/claude-night-market/tree/master/plugins/abstract). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Hook Scope Decision Guide\n\nThis skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.\n\n## Important: Auto-Loading Behavior\n\n> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.\n> Do NOT add `\"hooks\": \"./hooks/hooks.json\"` to your `plugin.json` - this causes duplicate load errors.\n> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.\n\n## The Three Scopes\n\n| Scope | Location | Audience | Committed? | Persistence |\n|-------|----------|----------|------------|-------------|\n| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |\n| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |\n| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |\n\n## Decision Framework\n\n### Question 1: Who needs this hook?\n\n**Only plugin users** → Plugin hooks\n- Hook is part of plugin's core functionality\n- Users expect it when they enable your plugin\n- Example: A YAML plugin validates YAML syntax on edit\n\n**All team members on this project** → Project hooks\n- Codebase-specific rules or protections\n- Team conventions that should be enforced\n- Example: Block modifications to `/src/production/` configs\n\n**Only me, everywhere** → Global hooks\n- Personal preferences or workflow optimizations\n- Cross-project utilities like logging\n- Example: Log all bash commands to personal audit trail\n\n### Question 2: Should this be version controlled?\n\n**Yes, as part of a distributable plugin** → Plugin hooks\n**Yes, shared with team in repo** → Project hooks\n**No, keep private** → Global hooks\n\n### Question 3: What's the persistence requirement?\n\n**Only when my plugin is active** → Plugin hooks\n**Always in this specific project** → Project hooks\n**Always, in every project I work on** → Global hooks\n\n## Scope Details\n\n### Plugin Hooks\n\n**Location**: `<plugin-root>/hooks/hooks.json`\n\n**When to use**:\n- The hook is intrinsic to your plugin's functionality\n- It should automatically activate when users enable your plugin\n- It only makes sense in the context of your plugin's features\n\n**Configuration**:\n```json\n{\n  \"PreToolUse\": [\n    {\n      \"matcher\": \"Read\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAU"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-abstract-hook-scope-guide\",\n  \"version\": \"1.9.19\",\n  \"publishedAt\": 1787749383222\n}"},{"path":"skill-card.md","content":"## Description:\n\nSelect hook scope (plugin, project, global) by audience.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and plugin authors use this skill to choose whether Claude Code hooks belong in plugin, project, or global settings based on audience, version-control needs, and persistence.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Hook examples can execute commands if copied into active Claude Code settings, especially global hooks that run in every session.\n\nMitigation: Review and test hook examples before installing them, and prefer the narrowest scope that matches the intended audience.\n\nRisk: Adding an explicit hooks entry for the standard plugin hook file can create duplicate loading errors.\n\nMitigation: Rely on the standard automatic loading behavior for hooks/hooks.json and only configure additional hook files explicitly.\n\n## Reference(s):\n\n- [Claude Night Market abstract plugin](https://github.com/athola/claude-night-market/tree/master/plugins/abstract)\n- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)\n- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, markdown, code, configuration]\n\n**Output Format:** [Markdown guidance with JSON, shell, and Python examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Documentation-only; does not install or execute hooks automatically.]\n\n## Skill Version(s):\n\n1.9.19 (source: release metadata; artifact frontmatter lists 1.9.8)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Select hook scope (plugin, project, global) by audience Skill: hook-scope-guide Owner: athola Summary: Select hook scope (plugin, project, global) by audience Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:03:03.222Z | user Release v1.9.19 v1.9.18 | 2026-08-15T21:27:36.044Z | user Release v1.9.18 v1.9.17 | 2026-07-30T05:27:31.047Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:44:25.965Z | user Release v1.9.16 v1.9.15 | 2026-07-04T21:19:04.853Z | user Releas","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1063,"uniquenessScore":49,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T21:52:24.730Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T21:52:24.730Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T00:32:44.808Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}