hooks-management

A manager for hooks, which are automated actions triggered by events in coding agents such as starting a session, running a tool, or changing a file. It supports adding, listing, updating, removing, and validating these automations.

In plain words
What is it for?
Use it to create or manage automation for Claude Code, Codex CLI, or OpenCode. Examples include running commands before or after tools, handling permissions, and responding to session events.
Why use it?
It avoids manually editing hook configuration and helps control repeated agent behavior from natural-language requests.

Skill for Claude CodeCodex

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/codealive-ai/ai-driven-development/hooks-management
Any agent
npx skills add CodeAlive-AI/ai-driven-development --skill hooks-management
Clone the repo
git clone --depth 1 https://github.com/CodeAlive-AI/ai-driven-development

Made for: Claude Code, Codex.

Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,557 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 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 $0.00082 $0.04557
Opus 5 $0.00041 $0.02278
Sonnet 5 $0.00016 $0.00911
Haiku 4.5 $0.00008 $0.00456

Measured 2d ago against content hash 9385099e22ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

hooks-management scanned grade D with 2 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 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/validate_hooks.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Reads agent configuration directoriesmediumAgent snooping

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

cat ~/.claude/settings.json 2>/dev/null || echo '{}'

Recursive force deletehighDestructive command

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

{ "permission": { "bash": { "rm -rf *": "ask" } } }
skills/hooks-management/SKILL.md · 453 lines

How it starts

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

Hooks Management

Manage hooks and automation through natural language commands.

IMPORTANT: After adding, modifying, or removing hooks, always inform the user that they need to restart the agent for changes to take effect. Hooks are loaded at startup.

Quick Reference

Hook Events (Claude Code, as of 2026-04 — 28 events):

  • Session lifecycle: SessionStart, SessionEnd, InstructionsLoaded
  • User input: UserPromptSubmit, UserPromptExpansion
  • Tool execution: PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch
  • Permissions: PermissionRequest, PermissionDenied
  • Model output: Stop, StopFailure
  • Subagents/tasks: SubagentStart, SubagentStop, TaskCreated, TaskCompleted, TeammateIdle
  • Config/state: ConfigChange, FileChanged, CwdChanged
  • Compaction: PreCompact, PostCompact
  • Worktree: WorktreeCreate, WorktreeRemove
  • MCP: Elicitation, ElicitationResult
  • Notifications: Notification

Handler types: command, http, mcp_tool, prompt, agent. Some events are command-only (PostCompact, PermissionDenied, Elicitation/ElicitationResult, FileChanged, CwdChanged, ConfigChange, InstructionsLoaded, WorktreeCreate/Remove, SubagentStart, StopFailure, TeammateIdle, Setup, SessionStart, SessionEnd, Notification).

Claude Code Settings Files:

  • User-wide: ~/.claude/settings.json
  • Project: .claude/settings.json
  • Local (not committed): .claude/settings.local.json
  • Drop-in policy fragments: ~/.claude/managed-settings.d/ (managed-settings only)

Codex CLI / Codex App Settings Files (current as of 2026-06):

  • User config: ~/.codex/config.toml
  • User hooks: ~/.codex/hooks.json or inline [hooks] tables in ~/.codex/config.toml
  • Project hooks: <repo>/.codex/hooks.json or inline [hooks] tables in <repo>/.codex/config.toml (trusted projects only)
  • Codex App and CLI share these config layers. In the App/IDE, the settings UI opens the same config.toml.
  • Hooks are enabled by default. Use [features].hooks = false to disable them. codex_hooks is a deprecated alias.
  • Non-managed Codex command hooks must be reviewed/trusted with /hooks; changed hook definitions are skipped until trusted.

Read the full file on GitHub · 453 lines

Files

What ships with it

5 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.

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. 2d ago First seen · 453 lines · 82 tokens per session scan D 9385099e22ae

Subscribe to this mod's changes

hooks-management is a skill published in the GitHub repository CodeAlive-AI/ai-driven-development (131 stars, last pushed 4d ago), licensed MIT. It adds 82 tokens to every session and 4,557 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). 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

map-auto

Single-entry autonomous autopilot: routes a task through the existing MAP workflows via routetask, then drives the selected chain (map-plan -> map-efficient -> map-check -> map-review, as routed) end-to-end to a committed feature branch in one session, auto-approving routine workflow-control holds and hard-stopping on…

azalio/map-framework · 165 tokens

map-resume

Resume an interrupted MAP workflow from .map/ /stepstate.json checkpoint. Use when returning after context exhaustion, /clear, or a session crash mid-workflow. Do NOT use to start new work; use map-plan or map-efficient.

azalio/map-framework · 53 tokens

map-skill-eval

Evaluate a /map- skill's trigger accuracy and cost. Use when asked to measure skill trigger accuracy, run an eval-set, or check token/duration cost via mapify skill-eval. Do NOT use to plan or implement; use map-plan or map-efficient.

azalio/map-framework · 61 tokens

create-workflows

Creates and revises portable declarative AI workflow files using Markdown frontmatter, DAG nodes, provider IDs, artifact references, imports, reusable inputs, findings artifacts, and review loops. Use when asked to author, improve, modularize, or validate .task.md workflows for CLI-based multi-agent workflow…

crewplaneai/crewplane · 91 tokens

intuitive-doc

Create and maintain an intuitive human documentation surface for AI-agent-developed repos. Use when humans should only need README.md, ARCHITECTURE.md, STATUS.md, and docs/human/ while planning logs, generated docs, retrospectives, ADR detail, and implementation evidence stay in AI-agent-only folders.

MiaoDX/intuitive-flow · 64 tokens

skill-runner

Run a bounded development task through named skills in an isolated, tmux-backed Codex or Claude session. Use for durable or artifact-sensitive worker phases, supervised skill runs, and post-run skill evaluation.

MiaoDX/intuitive-flow · 45 tokens