hook-template

hook-template is a skill for Claude Code from claude-world/director-mode-lite. It costs 39 tokens per session (1,703 once invoked), scanned A, original, MIT.

A template generator for Claude Code hooks, which are scripts that run when events such as tool use, session changes, or notifications occur. It creates a hook script and its settings configuration from a stated purpose.

In plain words
What is it for?
Use it when adding a new hook, such as one that runs before or after a tool call, when a session starts, or when a task finishes.
Why use it?
Writing event handlers and their configuration from scratch makes it easy to use the wrong event or format. Templates provide a starting structure for common hook jobs.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Part of the director-mode-lite plugin — 36 skills, 14 agents shipped together

Good fit Use it when adding a new hook, such as one that runs before or after a tool call, when a session starts, or when a task finishes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/claude-world/director-mode-lite/hook-template
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 claude-world/director-mode-lite --skill hook-template
Clone the repo
git clone --depth 1 https://github.com/claude-world/director-mode-lite

Made for: Claude Code.

Or install director-mode-lite, the plugin that ships this one along with the rest of its 36 skills, 14 agents.

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-template

README.md
[![agentmods](https://agentmods.dev/badge/skills/claude-world/director-mode-lite/hook-template.svg)](https://agentmods.dev/skills/claude-world/director-mode-lite/hook-template)
Your own site
<a href="https://agentmods.dev/skills/claude-world/director-mode-lite/hook-template"><img src="https://agentmods.dev/badge/skills/claude-world/director-mode-lite/hook-template.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,703 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00039 $0.01703
Opus 5 $0.00019 $0.00851
Sonnet 5 $0.00008 $0.00341
Haiku 4.5 $0.00004 $0.00170

Measured 8d ago against content hash 36715569d526, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

hook-template scanned grade A with 0 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/hook-template/SKILL.md · 250 lines

How it starts

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

Hook Template Generator

Generate a hook script and configuration based on requirements.

Usage: /hook-template [hook-event] [purpose]


Hook Events

Claude Code defines 30 hook events. The common ones, grouped:

Group Events
Lifecycle SessionStart, SessionEnd, Setup
Prompt UserPromptSubmit, UserPromptExpansion
Tool PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch
Permission PermissionRequest, PermissionDenied
Subagent SubagentStart, SubagentStop
Stop Stop, StopFailure
Task TaskCreated, TaskCompleted
Compaction PreCompact, PostCompact
Notification Notification, MessageDisplay
MCP elicitation Elicitation, ElicitationResult
Environment ConfigChange, CwdChanged, FileChanged, InstructionsLoaded, WorktreeCreate, WorktreeRemove, TeammateIdle

That is all 30 events. See the official Claude Code hooks docs for the full list and each event's payload. The templates below cover the practical 90%.


Hook Config Fields

Field Type Required Default Notes
type String No command command, prompt, http, mcp_tool, or agent
command String If type=command - Shell command to execute
prompt String If type=prompt - Natural language prompt evaluated by an LLM
matcher String No - For tool events: tool name, regex, or *
timeout Integer No 60 Seconds, per hook
once Boolean No false Run hook only once per session
if String No - Conditional guard for the hook
statusMessage String No - Message shown while the hook runs

type: command (default) and type: prompt (LLM-evaluated) cover most needs. The http, mcp_tool, and agent entry types also exist for calling an endpoint, invoking an MCP tool, or dispatching a subagent.


Read the full file on GitHub · 250 lines

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. 8d ago First seen · 250 lines · 39 tokens per session scan A 36715569d526

Subscribe to this mod's changes

hook-template is a skill published in the GitHub repository claude-world/director-mode-lite (81 stars, last pushed 8d ago), licensed MIT. It adds 39 tokens to every session and 1,703 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. 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

concise

Concise communication mode. Cuts 60-70% of output tokens while keeping natural, readable English. Drops filler, hedging, and pleasantries but maintains grammar and sentence flow. Elaborate on request -- ask for detail and get it, then auto-return to concise. Use when user says "concise mode", "be concise", "less…

o4f6bgpac3/concise · 92 tokens

peekaboo

Provides runtime observation and interaction for native macOS interfaces through accessibility state and screenshots. Use when the task depends on visible or interactive state in a running SwiftUI/AppKit app: what is rendered, focused, selected, enabled, reachable through menus/windows/dialogs, or experienced across a…

johnkozaris/jko-claude-plugins · 104 tokens

mobile-flows-maestro

This skill should be used when Maestro is explicitly requested or already present and the task is to author, run, or debug iOS/Android Maestro flows; use Maestro MCP; or handle Maestro selectors, system UI, permissions, Keychain, JavaScript, waits, device state, flakiness, or CI. Evidence includes a .maestro directory…

johnkozaris/jko-claude-plugins · 102 tokens

validate-api

Run the project's Hurl scenarios with an OIDC access token passed as a secret variable.

johnkozaris/jko-claude-plugins · 20 tokens

validate-mobile

Run a Maestro flow on an explicitly selected iOS or Android device and report behavioral evidence.

johnkozaris/jko-claude-plugins · 20 tokens

kanso-audit

Use when the user asks for a code review, audit, pre-PR check, quality sweep, or pattern analysis of a diff, branch, module, or codebase. Also use when the user asks to "check" or "look over" their code for issues.

blakecyze/kanso · 60 tokens