Xpersona
H

hook-scope-guide

CLAWHUB · Unverified

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

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-abstract-hook-scope-guide
  1. 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.
  2. 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: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-abstract-hook-scope-guide/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

98,969 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: hook-scope-guide
description: Select hook scope (plugin, project, global) by audience
version: 1.9.8
triggers:
  - authoring a hook
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/abstract", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: abstract
---

> **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.


# Hook Scope Decision Guide

This skill helps you choose the right location for Claude Code hooks based on their purpose, audience, and persistence needs.

## Important: Auto-Loading Behavior

> **`hooks/hooks.json` is automatically loaded** by Claude Code when the plugin is enabled.
> Do NOT add `"hooks": "./hooks/hooks.json"` to your `plugin.json` - this causes duplicate load errors.
> The `hooks` field in `plugin.json` is only needed for additional hook files beyond the standard `hooks/hooks.json`.

## The Three Scopes

| Scope | Location | Audience | Committed? | Persistence |
|-------|----------|----------|------------|-------------|
| **Plugin** | `hooks/hooks.json` in plugin | Plugin users | With plugin | When plugin enabled |
| **Project** | `.claude/settings.json` | Team members | Yes (repo) | Per project |
| **Global** | `~/.claude/settings.json` | Only you | Never | All sessions |

## Decision Framework

### Question 1: Who needs this hook?

**Only plugin users** → Plugin hooks
- Hook is part of plugin's core functionality
- Users expect it when they enable your plugin
- Example: A YAML plugin validates YAML syntax on edit

**All team members on this project** → Project hooks
- Codebase-specific rules or protections
- Team conventions that should be enforced
- Example: Block modifications to `/src/production/` configs

**Only me, everywhere** → Global hooks
- Personal preferences or workflow optimizations
- Cross-project utilities like logging
- Example: Log all bash commands to personal audit trail

### Question 2: Should this be version controlled?

**Yes, as part of a distributable plugin** → Plugin hooks
**Yes, shared with team in repo** → Project hooks
**No, keep private** → Global hooks

### Question 3: What's the persistence requirement?

**Only when my plugin is active** → Plugin hooks
**Always in this specific project** → Project hooks
**Always, in every project I work on** → Global hooks

## Scope Details

### Plugin Hooks

**Location**: `<plugin-root>/hooks/hooks.json`

**When to use**:
- The hook is intrinsic to your plugin's functionality
- It should automatically activate when users enable your plugin
- It only makes sense in the context of your plugin's features

**Configuration**:
```json
{
  "PreToolUse": [
    {
      "matcher": "Read",
      "hooks": [{
        "type": "command",
        "command": "echo 'Plugin reading: $CLAUDE_TOOL_INPUT' >> ${CLAU

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-abstract-hook-scope-guide",
  "version": "1.9.19",
  "publishedAt": 1787749383222
}

skill-card.md

## Description:

Select hook scope (plugin, project, global) by audience.

This skill is ready for commercial/non-commercial use.

## Publisher:

[athola](https://clawhub.ai/user/athola)

### License/Terms of Use:

MIT-0

## Use Case:

Developers 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.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Hook examples can execute commands if copied into active Claude Code settings, especially global hooks that run in every session.

Mitigation: Review and test hook examples before installing them, and prefer the narrowest scope that matches the intended audience.

Risk: Adding an explicit hooks entry for the standard plugin hook file can create duplicate loading errors.

Mitigation: Rely on the standard automatic loading behavior for hooks/hooks.json and only configure additional hook files explicitly.

## Reference(s):

- [Claude Night Market abstract plugin](https://github.com/athola/claude-night-market/tree/master/plugins/abstract)
- [Claude Code Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)
- [Claude Code Settings Configuration](https://docs.anthropic.com/en/docs/claude-code/settings)

## Skill Output:

**Output Type(s):** [guidance, markdown, code, configuration]

**Output Format:** [Markdown guidance with JSON, shell, and Python examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Documentation-only; does not install or execute hooks automatically.]

## Skill Version(s):

1.9.19 (source: release metadata; artifact frontmatter lists 1.9.8)

## Ethical Considerations:

Users 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.

Sponsored

Ads related to hook-scope-guide and adjacent AI workflows.