hook-template

hook-template is a skill for Claude Code from claude-world/director-mode-lite. It costs 39 tokens per session (1,966 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/github.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/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-template

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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,966 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.01966
Opus 5.5 $0.00016 $0.00786
Sonnet 5.5 $0.00008 $0.00393
Haiku 4.5 $0.00004 $0.00197

Measured 2d ago against content hash afc1ef74f3fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2d 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 · 258 lines

How it starts

The opening of the file, as written. The whole thing — 258 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 33 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
Model PreModelSwitch, PostModelSwitch
Environment ConfigChange, CwdChanged, DirectoryAdded, FileChanged, InstructionsLoaded, WorktreeCreate, WorktreeRemove, TeammateIdle

That is all 33 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 Yes - command, prompt, http, mcp_tool, or agent
command String If type=command - Shell command, or the executable when args is set
args Array No - Exec form: no shell, each element is one argument
prompt String If type=prompt/agent - Prompt for the model; $ARGUMENTS receives the input JSON
matcher String No all Exact names (Edit|Write), *, or a regex; ignored by events without matcher support
timeout Integer No 600 (command), 30 (prompt), 60 (agent) Seconds, per hook
if String No - Permission-rule filter such as Bash(git *); tool events only
onFailure String No continue block makes a hook that cannot run or times out block the action (v2.1.295+)
async Boolean No false Command hooks only: run in the background, cannot block
once Boolean No false Remove after the first successful run; honored only in skill frontmatter
statusMessage String No - Message shown while the hook runs

Read the full file on GitHub · 258 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. 2d ago Changed · +8 lines afc1ef74f3fc
  2. 1mo 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 (80 stars, last pushed 3d ago), licensed MIT. It adds 39 tokens to every session and 1,966 once invoked, about $0.0002 per session on Opus 5.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

session-recap

Document Claude Code sessions by extracting knowledge into cross-referenced documentation. Triggers on "recap the session", "summarize the work", or after significant code changes.

sxhmilyoyo/sundayhao-plugins · 39 tokens

knowledge-bank-lookup

Delegates knowledge bank lookups to Explore subagents with reflections-first strategy that learns from past mistakes. Checks /reflections/ directory before documentation to extract documented failures to avoid and proven approaches to apply. Automatically triggers when user mentions services ([project-a], [project-b]…

sxhmilyoyo/sundayhao-plugins · 94 tokens

kb-ingest

Ingest external sources into the knowledge bank through interactive study or quick filing. Two modes — Quick (summarize → file) and Study (theme-by-theme deep dive with online research and personal notes → multi-layer KB output → optional blog/slack synthesis). Triggers on "ingest this", "study this article", "add to…

sxhmilyoyo/sundayhao-plugins · 152 tokens

kb-lint

Health-check the knowledge bank for orphan documents, stale content, broken WikiLinks, index drift, and missing frontmatter. Generates a severity-graded report. Use this skill whenever the user mentions lint, health check, KB maintenance, stale docs, broken links, orphan pages, missing references, knowledge bank…

sxhmilyoyo/sundayhao-plugins · 103 tokens

session-manager

Set the current session's name, project, tags, or summary on its session note. Use when the user names, tags, or summarizes this session, sets its project, or mentions in passing what this session has been about.

sxhmilyoyo/sundayhao-plugins · 49 tokens