Source profileQuality 91/100

athola/claude-night-market/plugins/abstract/skills/hook-scope-guide/SKILL.md

hook-scope-guide

Select hook scope (plugin, project, global) by audience. Use when authoring a hook.

Source repository stars
330
Declared platforms
1
Static risk flags
0
Last source update
2026-08-24
Source checked
2026-08-25

Decision brief

What it does: where it fits

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

Best for

  • Use when authoring a hook.

Not for

  • Writing the hook itself (use abstract:hook-authoring)
  • Scoring an existing hook (use abstract:hooks-eval)

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeDeclaredSource recordInstall path and trigger
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/athola/claude-night-market --skill "plugins/abstract/skills/hook-scope-guide"
Safe inspection promptEditorial

Inspect the Agent Skill "hook-scope-guide" from https://github.com/athola/claude-night-market/blob/90037391d2db6536f67a7ccc8dee7c6819f170b7/plugins/abstract/skills/hook-scope-guide/SKILL.md at commit 90037391d2db6536f67a7ccc8dee7c6819f170b7. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Skip heavy context for review agents

    inputdata = json.loads(sys.stdin.read()) if inputdata.get("agenttype") in ["code-reviewer", "quick-query"]: print(json.dumps({"hookSpecificOutput": {"additionalContext": "Minimal"}}))

    Plugin hooks: Reduce overhead for lightweight agentsProject hooks: Skip governance for review-only agentsGlobal hooks: Customize logging verbosity per agent
  2. 02

    When NOT To Use

    Writing the hook itself (use abstract:hook-authoring)

    Writing the hook itself (use abstract:hook-authoring)Scoring an existing hook (use abstract:hooks-eval)- Writing the hook itself (use abstract:hook-authoring) - Scoring an existing hook (use abstract:hooks-eval)
  3. 03

    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/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 onl…
  4. 04

    The Three Scopes

    Review the “The Three Scopes” section in the pinned source before continuing.

    Review and apply the “The Three Scopes” source section.
  5. 05

    Decision Framework

    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

    Hook is part of plugin's core functionalityUsers expect it when they enable your pluginExample: A YAML plugin validates YAML syntax on edit

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars330SourceRepository attention, not individual Skill quality
Compatibility1 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
athola/claude-night-market
Skill path
plugins/abstract/skills/hook-scope-guide/SKILL.md
Commit
90037391d2db6536f67a7ccc8dee7c6819f170b7
License
MIT
Collected
2026-08-25
Default branch
master
View the original SKILL.md

Hook Scope Decision Guide

Overview

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

When NOT To Use

  • Writing the hook itself (use abstract:hook-authoring)
  • Scoring an existing hook (use abstract:hooks-eval)

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

ScopeLocationAudienceCommitted?Persistence
Pluginhooks/hooks.json in pluginPlugin usersWith pluginWhen plugin enabled
Project.claude/settings.jsonTeam membersYes (repo)Per project
Global~/.claude/settings.jsonOnly youNeverAll 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:

{
  "PreToolUse": [
    {
      "matcher": "Read",
      "hooks": [{
        "type": "command",
        "command": "echo \"Plugin reading: $(jq -r '.tool_input.file_path')\" >> ${CLAUDE_PLUGIN_ROOT}/log.txt"
      }]
    }
  ]
}

Note: Use string matchers ("Read") not object matchers ({"toolName": "Read"}).

Key features:

  • Use ${CLAUDE_PLUGIN_ROOT} for plugin-relative paths
  • Auto-merges when plugin is enabled
  • Deactivates when plugin is disabled

Examples:

  • Validation hook for a linting plugin
  • Auto-formatting hook for a code style plugin
  • Logging hook for a debugging plugin

Project Hooks

Location: .claude/settings.json (in project root)

When to use:

  • Enforcing team-wide policies
  • Protecting project-specific resources
  • Codebase conventions that should survive across team members
  • Rules that should be reviewed in PRs

Configuration:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [{
          "type": "command",
          "command": "cmd=$(jq -r '.tool_input.command // empty'); if [[ \"$cmd\" == *\"production\"* ]]; then echo 'BLOCKED: Production access requires approval'; exit 1; fi"
        }]
      }
    ]
  }
}

Note: Use string matchers ("Bash") not object matchers.

Key features:

  • Committed to version control
  • Shared across all team members
  • Changes are visible in PRs (governance trail)
  • Project-specific, not personal

Examples:

  • Block modifications to production configs
  • Require test commands before completion
  • Warn about editing sensitive directories
  • Enforce project naming conventions

Global Hooks

Location: ~/.claude/settings.json

When to use:

  • Personal workflow preferences
  • Cross-project utilities
  • Organization-wide compliance you want everywhere
  • Private rules that shouldn't be shared

Configuration:

{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [{
          "type": "command",
          "command": "echo \"$(date): $(jq -r '.tool_name')\" >> ~/.claude/audit.log"
        }]
      }
    ]
  }
}

Key features:

  • Never committed to any repo
  • Applies to ALL Claude Code sessions
  • Personal to your user account
  • Survives across projects

Examples:

  • Personal audit logging
  • Cross-project safety rules
  • Custom notification integrations
  • Development environment preferences

Loading Order & Precedence

Claude Code loads settings in this priority (highest first):

  1. Enterprise policies (organization-managed)
  2. Command-line arguments (claude --flag)
  3. Local project settings (.claude/settings.local.json)
  4. Shared project settings (.claude/settings.json)
  5. User settings (~/.claude/settings.json)

Important: Multiple hooks from different scopes can respond to the same event. When they do, all matching hooks execute in parallel.

Quick Reference: Scope Selection

Is this hook part of a plugin's core functionality?
├─ YES → Plugin hooks (hooks/hooks.json in plugin)
└─ NO ↓

Should all team members on this project have this hook?
├─ YES → Project hooks (.claude/settings.json)
└─ NO ↓

Should this hook apply to all my Claude sessions?
├─ YES → Global hooks (~/.claude/settings.json)
└─ NO → Reconsider if you need a hook at all

Security Considerations

Plugin hooks:

  • Audited as part of plugin installation
  • Users consent when enabling plugin
  • Scope limited to plugin's purpose

Project hooks:

  • Visible to all team members
  • Changes reviewed in PRs
  • Should reflect team consensus

Global hooks:

  • Execute with your credentials everywhere
  • Can affect all projects unexpectedly
  • Review security implications carefully
  • Test thoroughly before adding

Common Patterns by Scope

Plugin Hook Patterns

  • Validation: Check files match plugin's format
  • Auto-completion: Suggest plugin-specific completions
  • Logging: Track plugin-specific operations

Project Hook Patterns

  • Protection: Block dangerous operations on sensitive paths
  • Enforcement: Require tests, linting, or builds
  • Conventions: Warn about style or naming violations

Global Hook Patterns

  • Auditing: Log all operations for personal review
  • Safety: Universal dangerous command detection
  • Integration: Personal tool notifications

SessionStart Hook Enhancements (Claude Code 2.1.2+)

SessionStart hooks now receive additional input fields via stdin:

FieldTypeDescription
session_idstringUnique session identifier
sourceenum"startup" | "resume" | "clear" | "compact"
agent_typestringAgent name if --agent flag used, empty otherwise

Agent-Aware Hooks

The agent_type field enables scope-appropriate context injection:

# Skip heavy context for review agents
input_data = json.loads(sys.stdin.read())
if input_data.get("agent_type") in ["code-reviewer", "quick-query"]:
    print(json.dumps({"hookSpecificOutput": {"additionalContext": "Minimal"}}))

This is particularly useful for:

  • Plugin hooks: Reduce overhead for lightweight agents
  • Project hooks: Skip governance for review-only agents
  • Global hooks: Customize logging verbosity per agent

Related Skills

  • abstract:hook-authoring - For hook rule syntax and patterns
  • abstract:validate-plugin - For validating plugin structure including hooks

References

Exit Criteria

  • A single scope (plugin / project / global) is selected and the rationale traces through at least two of the three decision questions (audience, version control, persistence).
  • The selected scope's file location (hooks/hooks.json, .claude/settings.json, or ~/.claude/settings.json) is confirmed to exist or is created at the correct path.
  • Plugin hooks do not add "hooks": "./hooks/hooks.json" to plugin.json (duplicate-load guard); this absence is verified before the hook is deployed.
  • Global hooks are flagged with a security note confirming they apply to all Claude sessions on this machine.

Frequently asked questions

What to verify before installation and use

What does the hook-scope-guide source document cover?

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

How do I install hook-scope-guide?

The source record exposes this install command: npx skills add https://github.com/athola/claude-night-market --skill "plugins/abstract/skills/hook-scope-guide". Inspect the command and pinned source before running it.

Which Agent platforms does the source record declare?

The pinned source record declares support for: claude code.

Alternatives

Compare before choosing

Computed 100147

oaustegard/claude-skills

featuring

Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre

Computed 100106

apollographql/skills

skill-creator

Guide for creating effective skills for Apollo GraphQL and GraphQL development. Use this skill when: (1) users want to create a new skill, (2) users want to update an existing skill, (3) users ask about skill structure or best practices, (4) users need help writing SKILL.md files.

Computed 10062

terrylica/cc-skills

draft-park

Park a draft message/text in macOS Notes for the operator to review and edit, then read it back before acting (e.g. before sending to a real person). Notes is the source of truth (AppleScript CRUD, iCloud-synced, provenance-stamped with the Claude Code session UUID); Stickies is a best-effort view-only desktop mirror. Use whenever you draft something a human should confirm/edit before it is sent or committed — messages, replies, announcements, anything outbound. TRIGGERS - park this draft, park

Computed 1008

narrative-io/narrative-skills-marketplace

design-analysis

Translate a fuzzy analytical question into a rigorous investigation plan. Interrogates the ask, grounds the plan in the available data dictionary, applies analytical best practices, and produces a structured brief of query specifications for a downstream query-writing skill. Plans, does not write SQL. Use when: "why did X drop", "is there a relationship between A and B", "who are our highest-value customers", "what's driving the change in Y", "investigate this trend", "design an analysis for", "