ac-meta-hook-writer

ac-meta-hook-writer is a skill for Claude Code from WaterplanAI/agentic-config. It costs 78 tokens per session (1,919 once invoked), scanned A, original, MIT.

A workflow for writing Python hooks, which are scripts that run at defined points before or after an agent action.

In plain words
What is it for?
Use it to create hooks that allow, deny, or ask about tool use, validate input, log results, trigger follow-up actions, clean up, or report completed subagent work.
Why use it?
It helps hooks return the expected JSON decisions and keeps failures from unnecessarily stopping the workflow.

Skill for Claude Code

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

Part of the agentic-config plugin — 49 skills, 1 plugin shipped together

Good fit Use it to create hooks that allow, deny, or ask about tool use, validate input, log results, trigger follow-up actions, clean up, or report completed subagent work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/waterplanai/agentic-config/ac-meta-hook-writer
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 WaterplanAI/agentic-config --skill ac-meta-hook-writer
Clone the repo
git clone --depth 1 https://github.com/WaterplanAI/agentic-config

Made for: Claude Code.

Or install agentic-config, the plugin that ships this one along with the rest of its 49 skills, 1 plugin.

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 ac-meta-hook-writer

README.md
[![agentmods](https://agentmods.dev/badge/skills/waterplanai/agentic-config/ac-meta-hook-writer/github.svg)](https://agentmods.dev/skills/waterplanai/agentic-config/ac-meta-hook-writer)
Your own site
<a href="https://agentmods.dev/skills/waterplanai/agentic-config/ac-meta-hook-writer"><img src="https://agentmods.dev/badge/skills/waterplanai/agentic-config/ac-meta-hook-writer/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 ac-meta-hook-writer

Your own site · 80×15
<a href="https://agentmods.dev/skills/waterplanai/agentic-config/ac-meta-hook-writer"><img src="https://agentmods.dev/badge/skills/waterplanai/agentic-config/ac-meta-hook-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,919 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.
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.00078 $0.01919
Opus 5 $0.00039 $0.00959
Sonnet 5 $0.00016 $0.00384
Haiku 4.5 $0.00008 $0.00192

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

Security

Grade A, and why

ac-meta-hook-writer 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 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.

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.

packages/pi-ac-meta/skills/ac-meta-hook-writer/SKILL.md · 305 lines

How it starts

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

Hook Writer

Creates Python hooks with correct JSON output schemas and fail-open patterns.

Compatibility Note

This pi wrapper preserves the original hook authoring target. The wrapper only adapts invocation to pi; it does not retarget the generated hook format.

Hook Types

Event Trigger Use Case
PreToolUse Before tool execution Block dangerous commands, validate inputs
PostToolUse After tool execution Log results, trigger follow-up actions
UserPromptSubmit Before prompt processing Validate/transform user input
Stop Session ends Cleanup, summary generation
SubagentStop Subagent completes Aggregate results, status reporting

JSON Output Schema

PreToolUse/PostToolUse (Permission Decisions)

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow",
    "permissionDecisionReason": "Optional explanation"
  }
}
Field Values Required
hookEventName "PreToolUse" or "PostToolUse" Yes
permissionDecision "allow", "deny", "ask" Yes
permissionDecisionReason String explanation No (recommended for deny)

DEPRECATED FORMAT (DO NOT USE):

{"decision": "allow", "message": null}

UserPromptSubmit

{
  "hookSpecificOutput": {
    "hookEventName": "UserPromptSubmit",
    "modifiedPrompt": "Transformed user prompt"
  }
}

Stop/SubagentStop

{
  "hookSpecificOutput": {
    "hookEventName": "Stop"
  }
}

Python TypedDict Templates

PreToolUse/PostToolUse

from typing import TypedDict


class HookSpecificOutput(TypedDict, total=False):
    """Inner hook output structure."""
    hookEventName: str
    permissionDecision: str  # "allow" | "deny" | "ask"
    permissionDecisionReason: str


class HookOutput(TypedDict):
    """JSON output returned via stdout."""
    hookSpecificOutput: HookSpecificOutput

Read the full file on GitHub · 305 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. 11d ago First seen · 305 lines · 78 tokens per session scan A 1125234a18af

Subscribe to this mod's changes

ac-meta-hook-writer is a skill published in the GitHub repository WaterplanAI/agentic-config (30 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 1,919 once invoked, about $0.0004 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.