skill-018

skill-018 is a skill for Claude Code from legendtkl/agentic-skill-router. It costs 62 tokens per session (2,260 once invoked), scanned C, a copy of create-hooks, MIT.

A guide to Claude Code hooks, which are configured actions that run when specified events happen during a coding session.

In plain words
What is it for?
Use it to configure events such as before or after a tool runs, when a session starts, when a prompt is submitted, or when Claude stops.
Why use it?
Hooks can automate checks, logging, notifications, and other project-specific actions, including checks that can stop an operation before it runs.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Runs only inside a plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else, and the catalogue could not identify which plugin ships it.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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 skill-018

README.md
[![agentmods](https://agentmods.dev/badge/skills/legendtkl/agentic-skill-router/skill-018.svg)](https://agentmods.dev/skills/legendtkl/agentic-skill-router/skill-018)
Your own site
<a href="https://agentmods.dev/skills/legendtkl/agentic-skill-router/skill-018"><img src="https://agentmods.dev/badge/skills/legendtkl/agentic-skill-router/skill-018.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,260 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00062 $0.02260
Opus 5 $0.00031 $0.01130
Sonnet 5 $0.00012 $0.00452
Haiku 4.5 $0.00006 $0.00226

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

Security

Grade C, and why

skill-018 scanned grade C 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 6d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

"prompt": "Check if this command is destructive: $ARGUMENTS\n\nBlock if it contains: 'git push --force', 'rm -rf', 'git reset --hard'\n\nReturn: {\"decision\": \"approve\" or \"block\", \"reason\": \"explanation\"}"
Origin

This is a copy

100% identical to create-hooks — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

experiments/dci-compare/skillrouter-skills/skill-018/SKILL.md · 332 lines

How it starts

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

Hooks provide programmatic control over Claude's behavior without modifying core code, enabling project-specific automation, safety checks, and workflow customization.

<quick_start>

  1. Create hooks config file:
    • Project: .claude/hooks.json
    • User: ~/.claude/hooks.json
  2. Choose hook event (when it fires)
  3. Choose hook type (command or prompt)
  4. Configure matcher (which tools trigger it)
  5. Test with claude --debug

.claude/hooks.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '\"\\(.tool_input.command) - \\(.tool_input.description // \\\"No description\\\")\"' >> ~/.claude/bash-log.txt"
          }
        ]
      }
    ]
  }
}

This hook:

  • Fires before (PreToolUse) every Bash tool use
  • Executes a command (not an LLM prompt)
  • Logs command + description to a file

</quick_start>

<hook_types>

Event When it fires Can block?
PreToolUse Before tool execution Yes
PostToolUse After tool execution No
UserPromptSubmit User submits a prompt Yes
Stop Claude attempts to stop Yes
SubagentStop Subagent attempts to stop Yes
SessionStart Session begins No
SessionEnd Session ends No
PreCompact Before context compaction Yes
Notification Claude needs input No

Blocking hooks can return "decision": "block" to prevent the action. See references/hook-types.md for detailed use cases. </hook_types>

<hook_anatomy> <hook_type name="command"> Type: Executes a shell command

Use when:

  • Simple validation (check file exists)
  • Logging (append to file)
  • External tools (formatters, linters)
  • Desktop notifications

Input: JSON via stdin Output: JSON via stdout (optional)

{
  "type": "command",
  "command": "/path/to/script.sh",
  "timeout": 30000
}

</hook_type>

<hook_type name="prompt"> Type: LLM evaluates a prompt

Use when:

  • Complex decision logic
  • Natural language validation
  • Context-aware checks
  • Reasoning required

Input: Prompt with $ARGUMENTS placeholder Output: JSON with decision and reason

{
  "type": "prompt",
  "prompt": "Evaluate if this command is safe: $ARGUMENTS\n\nReturn JSON: {\"decision\": \"approve\" or \"block\", \"reason\": \"explanation\"}"
}

</hook_type> </hook_anatomy>

{
  "matcher": "Bash",           // Exact match
  "matcher": "Write|Edit",     // Multiple tools (regex OR)
  "matcher": "mcp__.*",        // All MCP tools
  "matcher": "mcp__memory__.*" // Specific MCP server
}

No matcher: Hook fires for all tools

{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [...]  // No matcher - fires on every user prompt
      }
    ]
  }
}

<input_output> Hooks receive JSON via stdin with session info, current directory, and event-specific data. Blocking hooks can return JSON to approve/block actions or modify inputs.

Read the full file on GitHub · 332 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. 6d ago First seen · 332 lines · 62 tokens per session scan C 106b1ab1c7e1

Subscribe to this mod's changes

skill-018 is a skill published in the GitHub repository legendtkl/agentic-skill-router (5 stars, last pushed 3mo ago), licensed MIT. It adds 62 tokens to every session and 2,260 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 100% identical to create-hooks, differing in 5 lines, and is treated as a copy.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens