new-hook

new-hook is a skill for Claude Code from AcKeskin/contexture. It costs 70 tokens per session (3,198 once invoked), scanned B, original, MIT.

An interview-led scaffold for creating a Claude Code hook, an automatic script triggered by a coding-agent event.

In plain words
What is it for?
It helps create a hook from a recipe and preview the required settings change before registration.
Why use it?
It handles the event matching, failure behavior, test fixtures, runner, and settings registration that are easy to configure incorrectly.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; names the NotebookEdit tool; mentions Claude Code.

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.

agentmods
npx agentmods add skills/ackeskin/contexture/new-hook
Any agent
npx skills add AcKeskin/contexture --skill new-hook
Clone the repo
git clone --depth 1 https://github.com/AcKeskin/contexture

Made for: Claude Code.

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 new-hook

README.md
[![agentmods](https://agentmods.dev/badge/skills/ackeskin/contexture/new-hook.svg)](https://agentmods.dev/skills/ackeskin/contexture/new-hook)
Your own site
<a href="https://agentmods.dev/skills/ackeskin/contexture/new-hook"><img src="https://agentmods.dev/badge/skills/ackeskin/contexture/new-hook.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,198 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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.00070 $0.03198
Opus 5 $0.00035 $0.01599
Sonnet 5 $0.00014 $0.00640
Haiku 4.5 $0.00007 $0.00320

Measured 2d ago against content hash 4473171f27f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

new-hook scanned grade B with 1 finding 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.

The scan reads SKILL.md. This mod also ships 9 executable files (lib/runner-template.js, lib/settings-merge.js, lib/settings-merge.test.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 directoriesmediumAgent snooping

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

description: "Scaffold a new Claude Code hook end-to-end from a recipe — produces the hook file, payload fixtures, a Node-based runner, and the ~/.claude/settings.json registration (diff previewed). Use when the user typ
skills/new-hook/SKILL.md · 213 lines

How it starts

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

new-hook

The hook scaffold organ. Closes the gap that no other skill helps with: building new Claude Code hooks correctly, including the matcher / event vocabulary, the fail-open exit-code contract, and the high-stakes ~/.claude/settings.json registration edit.

When to run

  • User types /new-hook (explicit trigger).
  • User says "scaffold a hook," "add a new hook," "create a PreToolUse blocker for X."
  • Do not auto-fire. No session-start or event-hook triggers. Mode A only — every run goes through the interview.

Inputs

  1. Triggering message. Anything after /new-hook is hint text — used to bias recipe selection but never enough to skip the interview.
  2. Bootstrap state. Whether contexture/hooks/ is the symlink source for ~/.claude/hooks/. Detected at scaffold time, not configured.
  3. Existing hooks tree. ~/.claude/hooks/ (and contexture/hooks/ when bootstrapped) — used for the collision check on the chosen hook name.
  4. Existing settings. ~/.claude/settings.json — read once for the merge contract.

Procedure

1. Recipe selection

List the recipes available in recipes/. Each recipe folder has a README.md with a one-line description, the matcher, and the event. Show them as a numbered list:

Which recipe?
  1. bash-command-blocker (PreToolUse, matcher: Bash) — pattern-match a Bash command, block on hit
  2. file-write-blocker (PreToolUse, matcher: Write|Edit|MultiEdit|NotebookEdit) — block file writes by path
  3. mcp-tool-blocker (PreToolUse, matcher: mcp__*) — block a specific MCP tool by exact name
  4. context-injector (SessionStart, matcher: startup|compact) — inject context at session start
  5. session-recovery-advisory (SessionStart, matcher: clear|compact) — scan the prior transcript and nudge to recover something lost across a clear/compact
  6. rule-prime (SessionStart[startup|clear|compact] + UserPromptSubmit) — mechanically prime resolved architectural rules into context; floor at session start, incremental tiers per prompt

Read the full file on GitHub · 213 lines

Files

What ships with it

27 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. 2d ago First seen · 213 lines · 70 tokens per session scan B 4473171f27f2

Subscribe to this mod's changes

new-hook is a skill published in the GitHub repository AcKeskin/contexture (2 stars, last pushed 1mo ago), licensed MIT. It adds 70 tokens to every session and 3,198 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.