hook-dev

hook-dev is a skill for Claude Code from andisab/swe-marketplace. It costs 80 tokens per session (4,718 once invoked), scanned C, original, MIT.

A guide for creating Claude Code hooks, which are shell commands that run automatically at specific events such as tool use or session changes.

In plain words
What is it for?
Use it to design hooks that format code, run validation, record commands, notify you, or block sensitive file changes.
Why use it?
It removes the need to rely on manual steps or AI decisions for repeatable checks, notifications, logging, and permission rules.

Skill for Claude Code

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

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the context-engineering plugin — 7 skills, 1 agent shipped together

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/andisab/swe-marketplace/hook-dev
Any agent
npx skills add andisab/swe-marketplace --skill hook-dev
Clone the repo
git clone --depth 1 https://github.com/andisab/swe-marketplace

Made for: Claude Code.

Or install context-engineering, the plugin that ships this one along with the rest of its 7 skills, 1 agent.

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-dev

README.md
[![agentmods](https://agentmods.dev/badge/skills/andisab/swe-marketplace/hook-dev.svg)](https://agentmods.dev/skills/andisab/swe-marketplace/hook-dev)
Your own site
<a href="https://agentmods.dev/skills/andisab/swe-marketplace/hook-dev"><img src="https://agentmods.dev/badge/skills/andisab/swe-marketplace/hook-dev.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,718 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 findings. 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.00080 $0.04718
Opus 5 $0.00040 $0.02359
Sonnet 5 $0.00016 $0.00944
Haiku 4.5 $0.00008 $0.00472

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

Security

Grade C, and why

hook-dev scanned grade C with 3 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 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

"command": "jq '.' | curl -d @- https://external-log-service.com"

Reads agent configuration directoriesmediumAgent snooping

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

- **User-level**: `~/.claude/settings.json` (all projects)

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

"command": "jq '.' | curl -d @- https://external-log-service.com"
plugins/context-engineering/skills/hook-dev/SKILL.md · 792 lines

How it starts

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

Hook Dev Skill

This skill helps create production-ready Claude Code hooks following Anthropic's official specifications.

What are Hooks?

Hooks are user-defined shell commands that execute at various points in Claude Code's lifecycle. They provide:

  • Deterministic control: Ensure actions happen automatically, not relying on LLM decisions
  • Workflow automation: Format code, run linters, log commands
  • Custom notifications: Alert when Claude needs input
  • Permission systems: Block sensitive file modifications
  • Feedback loops: Validate code changes against conventions

Hook vs Skill vs Command

Feature Hook Skill Command
Trigger Lifecycle event Context match User invocation
Type Shell command AI capability Prompt template
Use case Automation, validation Autonomous features Reusable prompts
Control Deterministic LLM-driven User-initiated

When to use Hooks: Automatic formatting, logging, notifications, permission control, code validation

Hook Events

Ten lifecycle events trigger hooks:

1. PreToolUse

Executes after Claude creates tool parameters but before processing.

Use cases:

  • Block edits to sensitive files (.env, production configs)
  • Validate bash commands before execution
  • Request confirmation for destructive operations
  • Log all tool usage for auditing
  • Modify tool inputs programmatically

Blocking capability: Yes - exit code 2 blocks with error fed to Claude; JSON output with "permissionDecision": "deny" also blocks

2. PostToolUse

Runs immediately after successful tool completion.

Use cases:

  • Format code after edits (Prettier, Black, gofmt)
  • Run linters after file modifications
  • Sync changes to external systems
  • Update indexes or caches

Blocking capability: No - tool already executed

3. UserPromptSubmit

Fires when users submit prompts, before Claude processes them.

Read the full file on GitHub · 792 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 · 792 lines · 80 tokens per session scan C c5b6de793edf

Subscribe to this mod's changes

hook-dev is a skill published in the GitHub repository andisab/swe-marketplace (21 stars, last pushed 17d ago), licensed MIT. It adds 80 tokens to every session and 4,718 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 3 findings (sends data to an external url, reads agent configuration directories, makes network calls). 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

pr

Comprehensive PR/issue review - analyzes architecture, tests, identifies unrelated changes mixed in, drafts review comment or issue comment. Use when user asks to review a PR, check a PR, look at PR changes, or comment on an issue.

umputun/cc-thingz · 51 tokens

new

Use when user asks to create a release, cut a release, or publish a version. Auto-detects GitHub vs GitLab vs Gitea, calculates semantic version, generates release notes from PRs/MRs or commits, shows preview for confirmation before publishing.

umputun/cc-thingz · 56 tokens

writing-style

Use for technical communication - GitHub/GitLab tickets, PR/MR descriptions, issue comments, code review comments, commit messages. Direct, brief style with no AI-speak. NOT for README.md, public docs, or blog posts.

umputun/cc-thingz · 52 tokens

root-cause-investigator

Systematic root cause analysis for errors, bugs, and unexpected behaviors using 5-Why methodology. Use when user reports errors, build failures, test failures, performance issues, integration problems, or any "it's not working" scenarios.

umputun/cc-thingz · 53 tokens

ccc-console

The Commander Console: one inline panel — agents, usage, safety, memory, history — plus a prompt bar that reaches this session. Publishing a snapshot is separate and consent-gated.

KevinZai/commander · 40 tokens

ccc-browse

Visual, filterable catalog of every CC Commander skill, agent, and command. Cascades from broad category picker into 4-at-a-time detail cards. Use when the user types…

KevinZai/commander · 41 tokens