hook-authoring

hook-authoring is a skill for Claude Code from athola/claude-night-market. It costs 20 tokens per session (6,023 once invoked), scanned B, original, MIT.

A guide for creating Claude Code hooks, which are scripts that run when specific events occur during an agent's work. It covers secure design, performance, scope, and testing for Claude Code and the Claude Agent SDK.

In plain words
What is it for?
Use it to plan and write hooks for validation, logging, or adding context, and to choose their scope and testing approach.
Why use it?
It helps prevent unsafe hooks, excessive delays, misplaced logic, and design mistakes while a hook is being created.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions subagents; positional $N argument.

Part of the abstract plugin — 16 skills, 17 commands, 5 agents, 4 hooks shipped together

Good fit Use it to plan and write hooks for validation, logging, or adding context, and to choose their scope and testing approach.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/athola/claude-night-market/hook-authoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add athola/claude-night-market --skill hook-authoring
Clone the repo
git clone --depth 1 https://github.com/athola/claude-night-market

Made for: Claude Code.

Or install abstract, the plugin that ships this one along with the rest of its 16 skills, 17 commands, 5 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hook-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/athola/claude-night-market/hook-authoring/github.svg)](https://agentmods.dev/skills/athola/claude-night-market/hook-authoring)
Your own site
<a href="https://agentmods.dev/skills/athola/claude-night-market/hook-authoring"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/hook-authoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hook-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/athola/claude-night-market/hook-authoring"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/hook-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,023 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 12 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 130
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 514
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 612
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 130
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 514
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 612
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Agent Snooping · line 487
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 498
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 731
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • medium Rogue Agent · line 78
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Excessive Agency · line 147
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Agent Snooping · line 373
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.06023
Opus 5 $0.00010 $0.03011
Sonnet 5 $0.00004 $0.01205
Haiku 4.5 $0.00002 $0.00602

Measured 11d ago against content hash 7bff3917ee7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

hook-authoring scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

├─ YES → Global hooks (~/.claude/settings.json)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

if "rm -rf /" in command:

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

plugins/abstract/skills/hook-authoring/SKILL.md · 738 lines

How it starts

The opening of the file, as written. The whole thing — 738 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When NOT To Use

  • Auditing a hook that already exists (use abstract:hooks-eval)
  • Choosing where a hook should live (use abstract:hook-scope-guide)
  • Authoring a skill rather than a hook (use abstract:skill-authoring)

Table of Contents

Hook Authoring Guide

Overview

Hooks are event interceptors that allow you to extend Claude Code and Claude Agent SDK behavior by executing custom logic at specific points in the agent lifecycle. They enable validation before tool use, logging after actions, context injection, workflow automation, and security enforcement.

This skill teaches you how to write effective, secure, and performant hooks for both declarative JSON (Claude Code) and programmatic Python (Claude Agent SDK) use cases.

Read the full file on GitHub · 738 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 738 lines · 20 tokens per session scan B 7bff3917ee7f

Subscribe to this mod's changes

hook-authoring is a skill published in the GitHub repository athola/claude-night-market (337 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 6,023 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-harness-optimizer

Use when agent harness optimization patterns for token efficiency, memory persistence, session management, and cross-harness parity. Use when optimizing agent performance, reducing token costs,.

oyi77/1ai-skills · 38 tokens

setup

Set up or update TDD Guard for the current project. Detects the test framework, installs or updates the matching reporter, and configures or migrates its configuration to match the current specification.

nizos/tdd-guard · 39 tokens

zapier-sdk

Zapier SDK for TypeScript. Programmatic access to 9,000+ apps on a user's behalf via Zapier's OAuth and audit layer. Use when writing code that needs to run actions in third-party apps (send an email, upsert a CRM record, look up a spreadsheet row, post to a chat) without managing per-app OAuth or vendor SDKs.…

zapier/sdk · 151 tokens

skill-performance-monitor

Use when monitor and analyze skill effectiveness in real-time. Track usage, success rates, response quality, and user satisfaction for continuous optimization. Use when monitoring and analyze skill effectiveness in real-time. track usage, success.

oyi77/1ai-skills · 47 tokens

react-hooks-composition

Advanced React hooks composition patterns - SWR integration, debounced search, memoized contexts, state machines, and performance optimization.

bobmatnyc/claude-mpm-skills · 29 tokens

api-testing

REST/GraphQL API testing with automated validation — test endpoints, validate responses, check status codes, and ensure API contracts.

kevinnft/ai-agent-skills · 27 tokens