Agent skill

Hook Scope Guide

by athola in athola/claude-night-market

Select hook scope (plugin, project, global) by audience. An agent skill from athola/claude-night-market.

MITAuto-check passedAgent Workflows

Install Hook Scope Guide

skills CLI
$ npx skills add athola/claude-night-market --skill hook-scope-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install athola/claude-night-market hook-scope-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/athola/claude-night-market.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/abstract/skills/hook-scope-guide .claude/skills/hook-scope-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hook-scope-guide
GitHub stars
342
Token cost
~2.2k tokens
SKILL.md length
846 words
Files
1
Skills in repo
159
Repo updated
First seen
Licence
MIT

At a glance

Select hook scope (plugin, project, global) by audience. An agent skill from athola/claude-night-market.

  • Works in 5 steps: Enterprise policies (organization-managed) → Command-line arguments (claude --flag) → Local project settings… → …
  • Authoring a hook
  • SKILL.md covers Overview, When NOT To Use, Important: Auto-Loading Behavior and The Three Scopes, plus 10 more sections
  • Calls claude

What it does

Hook Scope Guide is an agent skill from athola/claude-night-market. Select hook scope (plugin, project, global) by audience. Use when authoring a hook.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows. The repository describes itself as: 23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context… The licence is MIT.

When your agent uses it

  • Authoring a hook

Example prompts

  • “/hook-scope-guide”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  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)

What it can do on your machine

Read from SKILL.md and the folder at commit 9f3eb00. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.anthropic.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hook Scope Guide loads about 2.2k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 846 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~25
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from athola/claude-night-market at commit 9f3eb00, republished under its MIT licence (© athola). 846 words, ~2,218 tokens.

Download SKILL.mdSave it as .claude/skills/hook-scope-guide/SKILL.md (or your agent's skills folder).
name
hook-scope-guide
description
Select hook scope (plugin, project, global) by audience. Use when authoring a hook.
category
hook-development

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:

json
{
  "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:

json
{
  "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:

json
{
  "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
Show full SKILL.md (360 more words)Show less

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:

python
# 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
  • 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.

© athola, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

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

Open the folder on GitHubat commit 9f3eb00

Compare with similar skills

Hook Scope Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hook Scope Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hook Scope Guide this skillathola/claude-night-market342—~2.2kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k64 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k11 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k35 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers296k2 repos~5.1kAutomated safety check: PassMIT
Claude Code Agent Developmentanthropics/claude-plugins-official38k8 repos~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 64 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 35 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    296k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    795 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed

More from athola/claude-night-market

All 159 skills in this repo
  • Night Market Diagnostics Toolkit

    athola/claude-night-market

    Run and interpret repo diagnostic scripts (ratchets, validators, token stats).

    342 GitHub stars~3.4k tokensUpdated 2 days ago
    Auto-check passed
  • Skills Eval

    athola/claude-night-market

    Evaluate Claude skill quality through auditing. An agent skill from athola/claude-night-market.

    342 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Agent Teams

    athola/claude-night-market

    Coordinates Claude agent teams via filesystem protocol. An agent skill from athola/claude-night-market.

    342 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Delegation Core

    athola/claude-night-market

    Delegates execution to eight CLIs (Gemini, Qwen, MiniMax, GLM, Muse, Codex, OpenCode, Glimmer).

    342 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Elegant Code

    athola/claude-night-market

    Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

    342 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • Skill Library Mission

    athola/claude-night-market

    Build a project skill library in .claude/skills/ via discovery, parallel authoring, and review.

    342 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Hook Scope Guide

What does Hook Scope Guide do?

Select hook scope (plugin, project, global) by audience. An agent skill from athola/claude-night-market. Hook Scope Guide is an agent skill from athola/claude-night-market. Select hook scope (plugin, project, global) by audience.

When should I use Hook Scope Guide?

Hook Scope Guide fits situations like: authoring a hook.

How do I install Hook Scope Guide in Claude Code?

Run `npx skills add athola/claude-night-market --skill hook-scope-guide -a claude-code`. Or copy the skill folder (plugins/abstract/skills/hook-scope-guide in athola/claude-night-market) into .claude/skills/hook-scope-guide in your project. Claude Code loads it when a task matches its description.

How do I install Hook Scope Guide in Codex?

Run `npx skills add athola/claude-night-market --skill hook-scope-guide -a codex`. Or copy the skill folder (plugins/abstract/skills/hook-scope-guide in athola/claude-night-market) into .agents/skills/hook-scope-guide in your project. Codex loads it when a task matches its description.

Can I use Hook Scope Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add athola/claude-night-market --skill hook-scope-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hook-scope-guide, .gemini/skills/hook-scope-guide, .github/skills/hook-scope-guide and .opencode/skills/hook-scope-guide in your project.

What does Hook Scope Guide need to run?

Going by SKILL.md and its folder, Hook Scope Guide needs the command-line tools its instructions call (claude). Our summary lists: Python 3.

Does Hook Scope Guide access the network?

SKILL.md names 1 domain. As links in the text: docs.anthropic.com. This is read from the text; nothing was executed.

Is Hook Scope Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hook Scope Guide use?

Hook Scope Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hook Scope Guide use?

About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hook Scope Guide?

Skills that share tags, products or a category with Hook Scope Guide: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 296k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hook Scope Guide?

athola (a GitHub user) maintains it in athola/claude-night-market, which has 342 GitHub stars. The repository holds 159 skills in this directory. The repository was last updated on October 6, 2026.

Source: athola/claude-night-market on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.