generate-hooks

generate-hooks is a command for Claude Code from Jamie-BitFlight/claude_skills. It costs 21 tokens per session (583 once invoked), scanned A, original, MIT.

A command that turns findings from a kaizen analysis into proposed or installed Claude Code hooks. Hooks are automated actions that run at specific agent events.

In plain words
What is it for?
Use it to create hook configurations from an analysis file, either as draft proposals or directly in project settings.
Why use it?
It helps prevent repeated tool misuse, missing context, quality-gate failures, and other recurring mistakes without correcting them manually each time.

Command for Claude Code

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

Part of the agentskill-kaizen plugin — 4 skills, 4 commands, 2 agents shipped together

Good fit Use it to create hook configurations from an analysis file, either as draft proposals or directly in project settings.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jamie-bitflight/claude_skills/generate-hooks
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.

Clone the repo
git clone --depth 1 https://github.com/Jamie-BitFlight/claude_skills

Made for: Claude Code.

Or install agentskill-kaizen, the plugin that ships this one along with the rest of its 4 skills, 4 commands, 2 agents.

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 generate-hooks

README.md
[![agentmods](https://agentmods.dev/badge/commands/jamie-bitflight/claude_skills/generate-hooks/github.svg)](https://agentmods.dev/commands/jamie-bitflight/claude_skills/generate-hooks)
Your own site
<a href="https://agentmods.dev/commands/jamie-bitflight/claude_skills/generate-hooks"><img src="https://agentmods.dev/badge/commands/jamie-bitflight/claude_skills/generate-hooks/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 generate-hooks

Your own site · 80×15
<a href="https://agentmods.dev/commands/jamie-bitflight/claude_skills/generate-hooks"><img src="https://agentmods.dev/badge/commands/jamie-bitflight/claude_skills/generate-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 583 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.00021 $0.00583
Opus 5.5 $0.00008 $0.00233
Sonnet 5.5 $0.00004 $0.00117
Haiku 4.5 $0.00002 $0.00058

Measured 22d ago against content hash a9d322698a9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

generate-hooks 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 22d 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.

plugins/agentskill-kaizen/commands/generate-hooks.md · 52 lines

How it starts

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

Generate Claude Code hook configurations from kaizen analysis findings. Translates discovered anti-patterns into automated prevention hooks.

Arguments

  • --install — Write hooks directly to project settings instead of draft files. Without this flag, hooks are written as proposals to .planning/kaizen/hooks/.
  • --from <analysis-file> — Source analysis file to generate hooks from. Default: most recent analysis file in .planning/kaizen/.

Execution Steps

  1. Find source analysis. If --from is provided, use that file. Otherwise, glob for the most recent .planning/kaizen/analysis-*.md.

  2. Load proposal admission. Read Proposal Admission before selecting candidates. This is a document handoff, not a command invocation.

  3. Extract hook-eligible findings. Read the analysis file and identify findings where the recommended improvement type is "hook". Filter candidates for:

    • Tool misuse patterns (PreToolUse deny/redirect)
    • Missing context injection (SubagentStart)
    • Quality gate violations (SubagentStop, Stop)
    • Repeated manual corrections (PreToolUse)
  4. Spawn @improvement-generator agent. Delegate hook generation:

    subagent_type: improvement-generator
    prompt: "Generate hook configurations from these admitted findings: {findings}. Follow the loaded Proposal Admission guidance and write proposals to .planning/kaizen/hooks/ or install qualified hooks to settings if --install flag is set."
    

    The agent uses the kaizen-improvement skill which contains hook patterns and templates.

  5. Output results.

    Draft mode (default): Write each hook proposal as a separate file in .planning/kaizen/hooks/:

    .planning/kaizen/hooks/
    ├── tool-misuse-prevention.md
    ├── edit-before-read-guard.md
    └── research-to-files-enforcement.md
    

    Each file contains the hook configuration, script (if command type), rationale, and testing instructions.

Read the full file on GitHub · 52 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. 22d ago Changed · +2 lines a9d322698a9b
  2. 2mo ago First seen · 50 lines · 21 tokens per session scan A 64712dc0a644

Subscribe to this mod's changes

generate-hooks is a command published in the GitHub repository Jamie-BitFlight/claude_skills (67 stars, last pushed 19d ago), licensed MIT. It adds 21 tokens to every session and 583 once invoked, about $0.0001 per session on Opus 5.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.

Related

generate-hooks compared with commands from other repositories

generate-hooks next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
generate-hooksJamie-BitFlight/claude_skillsCommand6719d agoMITA21Claude Code
wsdanielmiessler/LifeOSCommand20k2d agoMITA0Claude Code
cancel-ralphanthropics/claude-plugins-officialCommand46kyesterdayApache-2.0A4Claude Code
engage.actionshypnguyen1209/offensive-claudeCommand41417d agoMITA11Claude Code
focusData-Wise/claude-pluginsCommand73d agoMITA0Claude Code
stuckData-Wise/claude-pluginsCommand73d agoMITA0Claude Code
quickstartorq-ai/assistant-pluginsCommand64d agoMITA23Claude Code