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.
npx agentmods add skills/richfrem/agent-plugins-skills/create-hooknpx skills add richfrem/agent-plugins-skills --skill create-hookgit clone --depth 1 https://github.com/richfrem/agent-plugins-skillsWrote 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.
[](https://agentmods.dev/skills/richfrem/agent-plugins-skills/create-hook)<a href="https://agentmods.dev/skills/richfrem/agent-plugins-skills/create-hook"><img src="https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/create-hook.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00046 | $0.00601 |
| Opus 5 | $0.00023 | $0.00300 |
| Sonnet 5 | $0.00009 | $0.00120 |
| Haiku 4.5 | $0.00005 | $0.00060 |
Grade A, and why
create-hook 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Follow the create-hook skill workflow to design and generate a hook configuration.
Inputs
$ARGUMENTS— optional hook event type (e.g.PreToolUse,Stop,PermissionRequest) or a use-case description (e.g. "block dangerous bash commands"). Omit for discovery.
Steps
- If
$ARGUMENTSnames an event or use case, use it to seed Phase 1 questions - Follow the create-hook phased workflow: select event, choose handler type (command / prompt / agent), design the matcher and logic, then write the hook entry
- Validate with
validate_hook_schema.pyand test withtest_hook.py - Report placement (global
hooks.jsonvs skill-scoped frontmatter) and next steps
Output
hooks.json entry or SKILL.md frontmatter block with complete hook configuration
(event, matcher, handler type, command/prompt body, output schema).
Hook Script Standards
When generating a Python hook script, always apply these two rules:
Cross-platform python command — use python3 ... || python ... in hooks.json so the hook works on both macOS/Linux (python3) and Windows (python):
{ "type": "command", "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/script.py || python ${CLAUDE_PLUGIN_ROOT}/hooks/script.py" }
Project-type guard — hooks run in every project, not just ones that have initialized this plugin. Add an early-exit guard at the top of main() so the script skips silently in projects that lack the required context:
def main():
project_root = Path(os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd()))
if not (project_root / "context").exists():
return # Not an initialized project — skip silently
...
Adapt the guard to whatever directory/file your hook requires (e.g. .agent/, context/os-state.json).
Edge Cases
- If
$ARGUMENTSis empty: begin with the event selection question in Phase 1 - If the requested event is not in the 13 supported events: explain valid options
- If the use case implies a skill-scoped hook (enforce invariant only during one skill): generate frontmatter syntax instead of a global hooks.json entry
- If user wants to auto-approve subagent permissions: use PermissionRequest + prompt handler
What ships with it
60 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.
- acceptance-criteria.md 395 B
- evals/evals.json 876 B
- evals/results.tsv 417 B
- fallback-tree.md 1.4 KB
- references/acceptance-criteria.md 42 B
- references/advanced.md 31 B
- references/fallback-tree.md 36 B
- references/hitl-interaction-design.md 46 B
- references/migration.md 32 B
- references/pattern-decision-matrix.md 46 B
- references/patterns.md 31 B
- references/patterns/action-forcing-output-with-deadline-attribution.md 82 B
- references/patterns/adversarial-objectivity-constraint.md 69 B
- references/patterns/anti-pattern-vaccination.md 59 B
- references/patterns/anti-symptom-triage.md 54 B
- references/patterns/artifact-embedded-execution-audit-trail.md 74 B
- references/patterns/artifact-generation-xss-compliance-gate.md 74 B
- references/patterns/artifact-lifecycle.md 53 B
- references/patterns/artifact-state-interrogative-routing.md 71 B
- references/patterns/asynchronous-benchmark-metric-capture.md 72 B
- references/patterns/audience-segmented-information-filtering.md 75 B
- references/patterns/category-calibrated-benchmark-anchoring.md 74 B
- references/patterns/category-semantic-deferred-tool-binding.md 74 B
- references/patterns/chained-command-invocation.md 61 B
- references/patterns/chained-commands.md 51 B
- references/patterns/client-side-compute-sandbox-constraint.md 73 B
- references/patterns/complexity-tiered-output.md 59 B
- references/patterns/conditional-step-inclusion.md 61 B
- references/patterns/connector-placeholders.md 57 B
- references/patterns/cyclical-state-propagation-contract.md 70 B
- references/patterns/delegated-constraint-verification-loop.md 73 B
- references/patterns/dual-mode-degradation.md 56 B
- references/patterns/dual-mode-meta-skill.md 55 B
- references/patterns/dual-register-communication-enforcement.md 74 B
- references/patterns/dynamic-specification-fetching.md 65 B
- references/patterns/embedded-deterministic-scoring-formula.md 73 B
- references/patterns/escalation-taxonomy.md 54 B
- references/patterns/explicit-seed-anchored-determinism.md 69 B
- references/patterns/graduated-autonomy.md 53 B
- references/patterns/graduated-source-attributed-elicitation.md 74 B
- references/patterns/highly-procedural-fallback-trees.md 67 B
- references/patterns/iteration-directory-isolation.md 64 B
- references/patterns/lifecycle-aware-knowledge.md 60 B
- references/patterns/local-interactive-output-viewer-loop.md 71 B
- references/patterns/mandatory-counterfactual-scenario-templating.md 79 B
- references/patterns/mode-invariant-compliance-gate.md 65 B
- references/patterns/multi-actor-operational-coordination-manifest.md 80 B
- references/patterns/multi-dimensional-tone.md 57 B
- references/patterns/multi-modal-routing.md 54 B
- references/patterns/multi-source-synthesis.md 57 B
- references/patterns/multi-variant-trigger-optimizer.md 66 B
- references/patterns/negative-instruction-constraint.md 66 B
- references/patterns/output-classification.md 56 B
- references/patterns/passive-style-injection-payload.md 66 B
- references/patterns/persistent-plugin-configuration.md 66 B
- references/patterns/population-normative-distribution-constraint.md 79 B
- references/patterns/pre-committed-rollback-contract.md 66 B
- references/patterns/pre-execution-input-manifest.md 63 B
- references/patterns/pre-execution-workflow-commitment-diagram.md 76 B
- references/patterns/priority-ordered-scanning.md 60 B
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.
- today First seen · 56 lines · 46 tokens per session scan A 040f5d7718bb
create-hook is a skill published in the GitHub repository richfrem/agent-plugins-skills (6 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 601 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-09-03.
Other skills, from other repositories
kapso-whatsapp
How to interact with Kapso WhatsApp from the swarm — read inbound webhook payloads (text AND media), fetch message history, send free-form messages within the 24h session window (and template messages outside it), mark-as-read, show the typing indicator, send reactions, download media, verify webhook signatures, and…
composio
Use Composio from Agent Swarm through the agent-swarm x composio CLI route, the swarmx MCP tool, or a registered ctx.api.composio script connection. Trigger when a task needs connected third-party app tools such as Gmail, Google Calendar, Google Docs, Google Drive, GitHub, Slack, Notion, or HubSpot through Tool Router…
attio-interaction
Generic Attio CRM REST API v2 recipes for querying records, upserting companies/people/deals, writing notes/tasks/comments, managing lists, and handling webhooks.
scheduled-task-resilience
Guardrails for polling, scheduled jobs, and long-running external operations. Use whenever a task waits on CI, builds, deploys, browser jobs, or another asynchronous API so work survives heartbeat checks without duplicate delivery.
swarm-scripts
Bulk, repeat, fan-out, or data-heavy work: write and run swarm scripts (inline script-run, named script-upsert, durable launch-script-run). Covers the script-vs-tool rubric, the authoring contract (args first, ctx second), the seed catalog, connections and secrets, dbquery, and exposing a script as an API.
user-management
How to manage the user registry — creating users for new Slack/GitHub/GitLab/Linear identities, managing aliases, resolving users across platforms. Use when a new human interacts with the swarm or when user identity needs updating.