{"id":"4a97e030-85d2-43f7-98d9-6df1d821b9b6","shortId":"PvM2yw","kind":"skill","title":"hooks-management","tagline":"Manage hooks and automation for coding agents (Claude Code, Codex CLI, OpenCode). Use when users want to add, list, remove, update, or validate hooks. Triggers on requests like \"add a hook\", \"create a hook that...\", \"list my hooks\", \"remove the hook\", \"validate hooks\", or any men","description":"# Hooks Management\n\nManage hooks and automation through natural language commands.\n\n**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.\n\n## Quick Reference\n\n**Hook Events** (Claude Code, as of 2026-04 — 28 events):\n\n- *Session lifecycle*: SessionStart, SessionEnd, InstructionsLoaded\n- *User input*: UserPromptSubmit, UserPromptExpansion\n- *Tool execution*: PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch\n- *Permissions*: PermissionRequest, PermissionDenied\n- *Model output*: Stop, StopFailure\n- *Subagents/tasks*: SubagentStart, SubagentStop, TaskCreated, TaskCompleted, TeammateIdle\n- *Config/state*: ConfigChange, FileChanged, CwdChanged\n- *Compaction*: PreCompact, PostCompact\n- *Worktree*: WorktreeCreate, WorktreeRemove\n- *MCP*: Elicitation, ElicitationResult\n- *Notifications*: Notification\n\n**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).\n\n**Settings Files**:\n- User-wide: `~/.claude/settings.json`\n- Project: `.claude/settings.json`\n- Local (not committed): `.claude/settings.local.json`\n- Drop-in policy fragments: `~/.claude/managed-settings.d/` (managed-settings only)\n\n**Default control mechanism for PreToolUse**: emit JSON on stdout with `hookSpecificOutput.permissionDecision` set to `\"allow\"`, `\"deny\"`, **`\"ask\"`** (triggers the built-in user confirmation prompt), or **`\"defer\"`** (pause headless tool calls; resume with `-p --resume`). See [Decision Control](#decision-control-pretooluse). Do NOT roll your own confirmation schemes (env-var flags, interactive `osascript` prompts, bypass tokens) — those break the built-in UX and silently fail under existing `permissions.allow` entries.\n\n**Disable all hooks**: set `disableAllHooks: true` in settings.json.\n\n## Workflow\n\n### 1. Understand the Request\n\nParse what the user wants:\n- **Add/Create**: New hook for specific event and tool\n- **List/Show**: Display current hooks configuration\n- **Remove/Delete**: Remove specific hook(s)\n- **Update/Modify**: Change existing hook\n- **Validate**: Check hooks for errors\n\n### 2. Validate Before Writing\n\nAlways run validation before saving:\n```bash\npython3 \"$SKILL_PATH/scripts/validate_hooks.py\" ~/.claude/settings.json\n```\n\n### 3. Read Current Configuration\n\n```bash\ncat ~/.claude/settings.json 2>/dev/null || echo '{}'\n```\n\n### 4. Apply Changes\n\nUse Edit tool for modifications, Write tool for new files.\n\n## Adding Hooks\n\n### Translate Natural Language to Hook Config\n\n| User Says | Event | Matcher | Notes |\n|-----------|-------|---------|-------|\n| \"log all bash commands\" | PreToolUse | Bash | Logging to file |\n| \"format files after edit\" | PostToolUse | Edit\\|Write | Run formatter |\n| \"block .env file changes\" | PreToolUse | Edit\\|Write | Exit code 2 blocks |\n| \"notify me when done\" | Notification | \"\" | Desktop notification |\n| \"run tests after code changes\" | PostToolUse | Edit\\|Write | Filter by extension |\n| \"ask before dangerous commands\" | PreToolUse | Bash | Emit JSON `permissionDecision: \"ask\"` (built-in confirm UI) |\n| \"require manual approval for X\" | PreToolUse | Bash/Edit/Write | Same — emit JSON `permissionDecision: \"ask\"`, NOT exit 2 |\n| \"block unless confirmed\" | PreToolUse | Bash | Same — JSON `\"ask\"` lets the user approve per call |\n\n### Hook Configuration Template\n\n```json\n{\n  \"hooks\": {\n    \"EVENT_NAME\": [\n      {\n        \"matcher\": \"TOOL_PATTERN\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"SHELL_COMMAND\",\n            \"timeout\": 60\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Simple vs Complex Hooks\n\n**PREFER SCRIPT FILES** for complex hooks. Inline commands with nested quotes, `osascript`, or multi-step logic often break due to JSON escaping issues.\n\n| Complexity | Approach | Example |\n|------------|----------|---------|\n| Simple | Inline | `jq -r '.tool_input.command' >> log.txt` |\n| Medium | Inline | Single grep/jq pipe with basic conditionals |\n| Complex | **Script file** | Dialogs, multiple conditions, osascript, error handling |\n\n**Script location**: `~/.claude/hooks/` (create if needed)\n\n**Script template for PreToolUse** (`~/.claude/hooks/my-hook.sh`) — use JSON decision control as the primary mechanism; exit codes are a fallback for simple blocking only:\n\n```bash\n#!/bin/bash\nset -euo pipefail\n\n# Read JSON input from stdin\ninput=$(cat)\ncmd=$(echo \"$input\" | jq -r '.tool_input.command')\n\n# Your logic here\nif echo \"$cmd\" | grep -q 'pattern-requiring-confirmation'; then\n    # PRIMARY PATTERN for \"require user confirmation\": emit JSON on stdout.\n    # Claude Code will show its built-in confirm prompt to the user.\n    jq -n '{\n      hookSpecificOutput: {\n        hookEventName: \"PreToolUse\",\n        permissionDecision: \"ask\",\n        permissionDecisionReason: \"Explain why this call is risky\"\n      }\n    }'\n    exit 0\nfi\n\nif echo \"$cmd\" | grep -q 'pattern-to-hard-block'; then\n    # Hard block (no user override possible): JSON deny, NOT exit 2.\n    jq -n '{\n      hookSpecificOutput: {\n        hookEventName: \"PreToolUse\",\n        permissionDecision: \"deny\",\n        permissionDecisionReason: \"Reason shown to Claude\"\n      }\n    }'\n    exit 0\nfi\n\nexit 0  # Allow (silent)\n```\n\n**Why JSON decisions, not exit 2 or home-grown prompts:**\n- `permissionDecision: \"ask\"` triggers the built-in Claude Code confirm UI — the user sees a clean prompt and can allow/deny per-call.\n- `exit 2` is a blunt block; the user cannot override it from the UI, and Claude often re-tries with workarounds.\n- Home-grown schemes (env-var flags like `CONFIRMED=1`, `osascript` dialogs, bypass tokens) break the native UX, leak into command history, and are silently bypassed if the tool already has a matching `permissions.allow` rule.\n\n**Hook config using script**:\n```json\n{\n  \"type\": \"command\",\n  \"command\": \"~/.claude/hooks/my-hook.sh\"\n}\n```\n\n**Other handler types (2026)**: `http` (POSTs event JSON to a URL), `mcp_tool` (calls a tool on a configured MCP server), `prompt` (evaluates a prompt with an LLM, supports `$ARGUMENTS`), `agent` (runs an agentic verifier with tools). Some events are command-only (PostCompact, PermissionDenied, Elicitation/ElicitationResult, FileChanged, CwdChanged, ConfigChange, InstructionsLoaded, WorktreeCreate/Remove, SubagentStart, StopFailure, TeammateIdle, SessionStart/End, Notification).\n\n**Always**:\n1. Create script in `~/.claude/hooks/`\n2. Make executable: `chmod +x ~/.claude/hooks/my-hook.sh`\n3. Test with sample input: `echo '{\"tool_input\":{\"command\":\"test\"}}' | ~/.claude/hooks/my-hook.sh`\n\n### Common Patterns\n\n**Logging (PreToolUse)**:\n```json\n{\n  \"matcher\": \"Bash\",\n  \"hooks\": [{\n    \"type\": \"command\",\n    \"command\": \"jq -r '.tool_input.command' >> ~/.claude/command-log.txt\"\n  }]\n}\n```\n\n**File Protection (PreToolUse, exit 2 to block)**:\n```json\n{\n  \"matcher\": \"Edit|Write\",\n  \"hooks\": [{\n    \"type\": \"command\",\n    \"command\": \"jq -r '.tool_input.file_path' | grep -qE '(\\\\.env|secrets)' && exit 2 || exit 0\"\n  }]\n}\n```\n\n**Auto-format (PostToolUse)**:\n```json\n{\n  \"matcher\": \"Edit|Write\",\n  \"hooks\": [{\n    \"type\": \"command\",\n    \"command\": \"file=$(jq -r '.tool_input.file_path'); [[ $file == *.ts ]] && npx prettier --write \\\"$file\\\" || true\"\n  }]\n}\n```\n\n**Desktop Notification (Notification)**:\n```json\n{\n  \"matcher\": \"\",\n  \"hooks\": [{\n    \"type\": \"command\",\n    \"command\": \"osascript -e 'display notification \\\"Claude needs attention\\\" with title \\\"Claude Code\\\"'\"\n  }]\n}\n```\n\n## Decision Control (PreToolUse)\n\nPreToolUse hooks control tool execution by emitting JSON on stdout. This is the **default mechanism** — use it instead of exit codes whenever the intent is richer than \"silently allow / hard block\", especially when the user should be asked to confirm.\n\n| `permissionDecision` | Behavior | Use for |\n|----------------------|----------|---------|\n| `\"allow\"` | Bypass permissions, proceed silently | Pre-approving a safe call |\n| `\"deny\"` | Block, reason shown to Claude | Hard block (no user override) |\n| `\"ask\"` | **Built-in Claude Code confirm UI** shown to user | \"Require manual approval for X\" — the canonical pattern |\n| `\"defer\"` | Pause headless tool call, resume via `-p --resume` | External-system integrations in headless (`-p`) sessions |\n\nAdditional JSON fields:\n- `permissionDecisionReason` — shown to the user for `\"allow\"`/`\"ask\"`, shown to Claude for `\"deny\"`\n- `updatedInput` — modify tool input before execution\n- `additionalContext` — inject context for Claude before the tool executes\n\n### Ask user before dangerous command (the canonical pattern)\n\nWhen the user says anything like **\"require manual confirmation\"**, **\"ask before doing X\"**, **\"don't run Y without my approval\"** — this is the pattern. Do not invent bypass env vars, `osascript` dialogs, or confirmation tokens. The built-in prompt already handles per-call allow/deny and is the only path that integrates with existing `permissions.allow` rules correctly.\n\n```bash\n#!/bin/bash\nset -euo pipefail\ninput=$(cat)\ncmd=$(echo \"$input\" | jq -r '.tool_input.command // empty')\n\nif echo \"$cmd\" | grep -qE 'supabase\\s+db\\s+reset'; then\n    jq -n '{\n      hookSpecificOutput: {\n        hookEventName: \"PreToolUse\",\n        permissionDecision: \"ask\",\n        permissionDecisionReason: \"This will destroy and recreate the local database.\"\n      }\n    }'\nelse\n    exit 0\nfi\n```\n\n### Deny with reason (hard block)\n\n```bash\njq -n '{\n  hookSpecificOutput: {\n    hookEventName: \"PreToolUse\",\n    permissionDecision: \"deny\",\n    permissionDecisionReason: \"Destructive command blocked by hook\"\n  }\n}'\n```\n\n### Gotcha: `\"ask\"` vs existing `permissions.allow` rules\n\nIf the tool call already matches an entry in `.claude/settings.local.json` → `permissions.allow` (for example, `\"Bash\"` is blanket-allowed for this session), the hook's `\"ask\"` is **bypassed** and the call proceeds silently. Symptom: the hook appears to do nothing. Diagnose by reading `.claude/settings.local.json` and narrowing the allow rule, or remove the blanket allow for the matcher while the hook is in effect.\n\nSee [references/claude-event-schemas.md](references/claude-event-schemas.md) for the full output schema.\n\n## Codex CLI Hooks\n\nAs of CLI v0.124.0 (April 2026) Codex hooks are **stable** and support six lifecycle events: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PermissionRequest`, `PostToolUse`, `Stop`. Hooks live inline in `config.toml` (preferred) or in `hooks.json`.\n\nEnable the feature flag:\n```toml\n# ~/.codex/config.toml\n[features]\ncodex_hooks = true\n```\n\nMinimal PreToolUse blocking hook:\n```toml\n[[hooks.PreToolUse]]\nmatcher = \"^Bash$\"\n\n[[hooks.PreToolUse.hooks]]\ntype = \"command\"\ncommand = '/usr/bin/python3 ~/.codex/hooks/policy.py'\ntimeout = 30\nstatusMessage = \"Checking Bash command\"\n```\n\nBlocking semantics: exit code `2` blocks (stderr is reason), or emit JSON `{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"deny\", \"permissionDecisionReason\": \"...\"}}`. Starlark rules in `.codex/rules/` are still useful for static command policy and complement hooks.\n\nSee [references/codex-hooks.md](references/codex-hooks.md) for full Codex hooks reference, all event input/output schemas, common patterns, and migration from the legacy `AfterAgent` / `AfterToolUse` events.\n\n## OpenCode Hooks (Plugin-based)\n\nOpenCode (anomalyco/opencode v1.14.x) does NOT use config-based shell hooks. Hooks are TypeScript/JavaScript **plugins** that subscribe to lifecycle events. The closest analogue to `PreToolUse` is `tool.execute.before` — throwing inside it blocks the tool call.\n\n```typescript\n// .opencode/plugins/env-protection.ts\nimport type { Plugin } from \"@opencode-ai/plugin\"\n\nexport default (async () => ({\n  tool: {\n    execute: {\n      before: async (input, output) => {\n        if (output.args.filePath?.includes(\".env\")) {\n          throw new Error(\"Reading .env is forbidden\")\n        }\n      },\n    },\n  },\n})) satisfies Plugin\n```\n\n**Plugin locations**:\n- Project: `.opencode/plugins/*.ts`\n- Global: `~/.config/opencode/plugins/*.ts`\n- npm packages: listed in `opencode.json` under `plugin: []`\n\n**Common events**: `tool.execute.before`, `tool.execute.after`, `session.idle`, `session.created`, `file.edited`, `permission.asked`, `command.executed` (~25 total).\n\n**Critical caveat (v1.14.x)**: `tool.execute.*` hooks **do NOT** fire for MCP tool calls — use the `permission` block in `opencode.json` to control MCP tool access instead.\n\nFor \"ask before\" semantics, prefer `permission` rules over plugin throws — they integrate with the built-in confirm UI:\n```json\n{ \"permission\": { \"bash\": { \"rm -rf *\": \"ask\" } } }\n```\n\nSee [references/opencode-hooks.md](references/opencode-hooks.md) for the full event catalog, migration patterns from Claude Code hooks, and npm plugin distribution.\n\n## Event Input Schemas\n\nSee [references/claude-event-schemas.md](references/claude-event-schemas.md) for complete JSON input schemas for each event type (Claude Code).\n\n## Validation\n\nRun validation script to check hooks:\n\n```bash\npython3 \"$SKILL_PATH/scripts/validate_hooks.py\" <settings-file>\n```\n\nValidates:\n- JSON syntax\n- Required fields (type, command/prompt)\n- Valid event names\n- Matcher patterns (regex validity)\n- Command syntax basics\n\n## Removing Hooks\n\n1. Read current config\n2. Identify hook by event + matcher + command pattern\n3. Remove from hooks array\n4. If array empty, remove the matcher entry\n5. If event empty, remove event key\n6. Validate and save\n\n## Exit Codes\n\n| Code | Meaning | Use Case |\n|------|---------|----------|\n| 0 | Success/Allow | Continue execution |\n| 2 | Block | Simple blocking (prefer JSON decision control for PreToolUse) |\n| Other | Error | Log to stderr, shown in verbose mode |\n\n## Security Checklist\n\nBefore adding hooks, verify:\n- [ ] No credential logging\n- [ ] No sensitive data exposure\n- [ ] Specific matchers (avoid `*` when possible)\n- [ ] Validated input parsing\n- [ ] Appropriate timeout for long operations\n\n## Troubleshooting\n\n**Hook not triggering**: Check matcher case-sensitivity, ensure event name is exact.\n\n**Command failing**: Test command standalone with sample JSON input.\n\n**Permission denied**: Ensure script is executable (`chmod +x`).\n\n**Timeout**: Increase timeout field or optimize command.","tags":["hooks","management","driven","development","codealive-ai","agent-safety","agent-skills","ai-coding","ai-driven-development","ai-safety","antigravity","bash"],"capabilities":["skill","source-codealive-ai","skill-hooks-management","topic-agent-safety","topic-agent-skills","topic-ai-coding","topic-ai-driven-development","topic-ai-safety","topic-antigravity","topic-bash","topic-claude-code","topic-codex-cli","topic-cursor","topic-developer-tools","topic-gemini-cli"],"categories":["ai-driven-development"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/CodeAlive-AI/ai-driven-development/hooks-management","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add CodeAlive-AI/ai-driven-development","source_repo":"https://github.com/CodeAlive-AI/ai-driven-development","install_from":"skills.sh"}},"qualityScore":"0.483","qualityRationale":"deterministic score 0.48 from registry signals: · indexed on github topic:agent-skills · 67 github stars · SKILL.md body (14,558 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:57:06.594Z","embedding":null,"createdAt":"2026-05-04T06:56:23.196Z","updatedAt":"2026-05-18T18:57:06.594Z","lastSeenAt":"2026-05-18T18:57:06.594Z","tsv":"'-04':97 '/.claude/command-log.txt':857 '/.claude/hooks':525,825 '/.claude/hooks/my-hook.sh':533,763,831,842 '/.claude/managed-settings.d':189 '/.claude/settings.json':177,323,330 '/.codex/config.toml':1309 '/.codex/hooks/policy.py':1327 '/.config/opencode/plugins':1465 '/bin/bash':552,1132 '/dev/null':332 '/plugin':1436 '/usr/bin/python3':1326 '0':620,657,660,884,1174,1641 '1':274,729,821,1599 '2':310,331,387,436,643,668,698,826,862,882,1338,1603,1645 '2026':96,767,1279 '25':1483 '28':98 '3':324,832,1611 '30':1329 '4':334,1616 '5':1624 '6':1631 '60':468 'access':1507 'ad':62,347,1667 'add':21,32 'add/create':283 'addit':1034 'additionalcontext':1056 'afterag':1385 'aftertoolus':1386 'agent':10,77,150,794,797 'ai':1435 'allow':207,661,960,976,1043,1218,1247,1253 'allow/deny':693,1118 'alreadi':749,1113,1205 'alway':67,314,820 'analogu':1415 'anomalyco/opencode':1394 'anyth':1077 'appear':1236 'appli':335 'approach':498 'appropri':1685 'approv':424,448,983,1011,1092 'april':1278 'argument':793 'array':1615,1618 'ask':209,407,416,433,444,611,675,969,998,1044,1065,1082,1162,1196,1225,1510,1533 'async':1439,1443 'attent':924 'auto':886 'auto-format':885 'autom':7,55 'avoid':1679 'base':1392,1401 'bash':319,328,362,365,412,441,551,849,1131,1181,1214,1321,1332,1530,1576 'bash/edit/write':428 'basic':512,1596 'behavior':973 'blanket':1217,1252 'blanket-allow':1216 'block':378,388,437,549,631,634,702,864,962,988,994,1180,1192,1316,1334,1339,1423,1500,1646,1648 'blunt':701 'break':252,491,734 'built':213,255,418,598,679,1000,1110,1524 'built-in':212,254,417,597,678,999,1109,1523 'bypass':249,732,745,977,1100,1227 'call':223,450,616,696,777,986,1021,1117,1204,1230,1426,1496 'cannot':705 'canon':1015,1071 'case':1640,1697 'case-sensit':1696 'cat':329,562,1137 'catalog':1541 'caveat':1486 'chang':79,302,336,381,400 'check':306,1331,1574,1694 'checklist':1665 'chmod':829,1719 'claud':11,92,592,655,681,712,922,927,992,1002,1047,1060,1545,1567 'claude/settings.json':179 'claude/settings.local.json':183,1210,1243 'clean':689 'cli':14,1272,1276 'closest':1414 'cmd':563,574,624,1138,1147 'code':9,12,93,386,399,543,593,682,928,952,1003,1337,1546,1568,1636,1637 'codex':13,1271,1280,1311,1371 'codex/rules':1355 'command':59,145,155,363,410,463,464,466,480,740,761,762,805,840,852,853,871,872,895,896,916,917,1069,1191,1324,1325,1333,1361,1594,1609,1704,1707,1727 'command-on':154,804 'command.executed':1482 'command/prompt':1586 'commit':182 'common':843,1378,1474 'compact':132 'complement':1364 'complet':1559 'complex':471,477,497,514 'condit':513,519 'config':354,756,1400,1602 'config-bas':1399 'config.toml':1299 'config/state':128 'configchang':129,162,812 'configur':295,327,452,782 'confirm':216,240,420,439,580,587,600,683,728,971,1004,1081,1106,1526 'context':1058 'continu':1643 'control':195,230,233,537,930,934,1504,1652 'correct':1130 'creat':35,526,822 'credenti':1671 'critic':1485 'current':293,326,1601 'cwdchang':131,161,811 'danger':409,1068 'data':1675 'databas':1171 'db':1152 'decis':229,232,536,665,929,1651 'decision-control-pretoolus':231 'default':194,945,1438 'defer':219,1017 'deni':208,640,650,987,1049,1176,1188,1350,1714 'desktop':394,909 'destroy':1166 'destruct':1190 'diagnos':1240 'dialog':517,731,1104 'disabl':265 'disableallhook':269 'display':292,920 'distribut':1551 'done':392 'drop':185 'drop-in':184 'due':492 'e':919 'echo':333,564,573,623,837,1139,1146 'edit':338,372,374,383,402,867,891 'effect':82,1262 'elicit':139 'elicitation/elicitationresult':159,809 'elicitationresult':140 'els':1172 'emit':199,413,430,588,938,1344 'empti':1144,1619,1627 'enabl':1304 'ensur':1699,1715 'entri':264,1208,1623 'env':243,379,724,879,1101,1449,1454 'env-var':242,723 'error':309,521,1452,1656 'escap':495 'especi':963 'euo':554,1134 'evalu':786 'event':91,99,152,288,357,456,770,802,1288,1375,1387,1412,1475,1540,1552,1565,1588,1607,1626,1629,1700 'exact':1703 'exampl':499,1213 'execut':110,828,936,1055,1064,1441,1644,1718 'exist':262,303,1127,1198 'exit':385,435,542,619,642,656,659,667,697,861,881,883,951,1173,1336,1635 'explain':613 'export':1437 'exposur':1676 'extens':406 'extern':1027 'external-system':1026 'fail':260,1705 'fallback':546 'featur':1306,1310 'fi':621,658,1175 'field':1036,1584,1724 'file':173,346,368,370,380,475,516,858,897,902,907 'file.edited':1480 'filechang':130,160,810 'filter':404 'fire':1492 'flag':245,726,1307 'forbidden':1456 'format':369,887 'formatt':377 'fragment':188 'full':1268,1370,1539 'global':1464 'gotcha':1195 'grep':575,625,877,1148 'grep/jq':509 'grown':672,721 'handl':522,1114 'handler':143,765 'hard':630,633,961,993,1179 'headless':221,1019,1031 'histori':741 'home':671,720 'home-grown':670,719 'hook':2,5,27,34,37,41,44,46,50,53,66,83,90,267,285,294,299,304,307,348,353,451,455,461,472,478,755,850,869,893,914,933,1194,1223,1235,1259,1273,1281,1295,1312,1317,1365,1372,1389,1403,1404,1489,1547,1575,1598,1605,1614,1668,1691 'hookeventnam':608,647,1159,1185,1347 'hooks-manag':1 'hooks.json':1303 'hooks.pretooluse':1319 'hooks.pretooluse.hooks':1322 'hookspecificoutput':607,646,1158,1184,1346 'hookspecificoutput.permissiondecision':204 'http':146,768 'identifi':1604 'import':60,1429 'includ':1448 'increas':1722 'inform':68 'inject':1057 'inlin':479,501,507,1297 'input':106,558,561,565,836,839,1053,1136,1140,1444,1553,1561,1683,1712 'input/output':1376 'insid':1421 'instead':949,1508 'instructionsload':104,163,813 'integr':1029,1125,1520 'intent':955 'interact':246 'invent':1099 'issu':496 'jq':502,566,605,644,854,873,898,1141,1156,1182 'json':200,414,431,443,454,494,535,557,589,639,664,759,771,847,865,889,912,939,1035,1345,1528,1560,1581,1650,1711 'key':1630 'languag':58,351 'leak':738 'legaci':1384 'let':445 'lifecycl':101,1287,1411 'like':31,727,1078 'list':22,39,1469 'list/show':291 'live':1296 'llm':791 'load':85 'local':180,1170 'locat':524,1460 'log':360,366,845,1657,1672 'log.txt':505 'logic':489,570 'long':1688 'make':827 'manag':3,4,51,52,191 'managed-set':190 'manual':423,1010,1080 'match':752,1206 'matcher':358,458,848,866,890,913,1256,1320,1590,1608,1622,1678,1695 'mcp':138,147,775,783,1494,1505 'mean':1638 'mechan':196,541,946 'medium':506 'men':49 'migrat':1381,1542 'minim':1314 'mode':1663 'model':118 'modif':341 'modifi':63,1051 'multi':487 'multi-step':486 'multipl':518 'n':606,645,1157,1183 'name':457,1589,1701 'narrow':1245 'nativ':736 'natur':57,350 'need':73,528,923 'nest':482 'new':284,345,1451 'note':359 'noth':1239 'notif':141,142,171,393,395,819,910,911,921 'notifi':389 'npm':1467,1549 'npx':904 'often':490,713 'opencod':15,1388,1393,1434 'opencode-ai':1433 'opencode.json':1471,1502 'opencode/plugins':1462 'opencode/plugins/env-protection.ts':1428 'oper':1689 'optim':1726 'osascript':247,484,520,730,918,1103 'output':119,1269,1445 'output.args.filepath':1447 'overrid':637,706,997 'p':226,1024,1032 'packag':1468 'pars':278,1684 'path':876,901,1123 'path/scripts/validate_hooks.py':322,1579 'pattern':460,578,583,628,844,1016,1072,1096,1379,1543,1591,1610 'pattern-requiring-confirm':577 'pattern-to-hard-block':627 'paus':220,1018 'per':449,695,1116 'per-cal':694,1115 'permiss':115,978,1499,1514,1529,1713 'permission.asked':1481 'permissiondecis':415,432,610,649,674,972,1161,1187,1349 'permissiondecisionreason':612,651,1037,1163,1189,1351 'permissiondeni':117,158,808 'permissionrequest':116,1292 'permissions.allow':263,753,1128,1199,1211 'pipe':510 'pipefail':555,1135 'plugin':1391,1407,1431,1458,1459,1473,1517,1550 'plugin-bas':1390 'polici':187,1362 'possibl':638,1681 'post':769 'postcompact':134,157,807 'posttoolbatch':114 'posttoolus':112,373,401,888,1293 'posttoolusefailur':113 'pre':982 'pre-approv':981 'precompact':133 'prefer':473,1300,1513,1649 'pretoolus':111,198,234,364,382,411,427,440,532,609,648,846,860,931,932,1160,1186,1291,1315,1348,1417,1654 'prettier':905 'primari':540,582 'proceed':979,1231 'project':178,1461 'prompt':149,217,248,601,673,690,785,788,1112 'protect':859 'python3':320,1577 'q':576,626 'qe':878,1149 'quick':88 'quot':483 'r':503,567,855,874,899,1142 're':715 're-tri':714 'read':325,556,1242,1453,1600 'reason':652,989,1178,1342 'recreat':1168 'refer':89,1373 'references/claude-event-schemas.md':1264,1265,1556,1557 'references/codex-hooks.md':1367,1368 'references/opencode-hooks.md':1535,1536 'regex':1592 'remov':23,42,65,297,1250,1597,1612,1620,1628 'remove/delete':296 'request':30,277 'requir':422,579,585,1009,1079,1583 'reset':1154 'restart':75 'resum':224,227,1022,1025 'rf':1532 'richer':957 'riski':618 'rm':1531 'roll':237 'rule':754,1129,1200,1248,1353,1515 'run':315,376,396,795,1088,1570 'safe':985 'sampl':835,1710 'satisfi':1457 'save':318,1634 'say':356,1076 'schema':1270,1377,1554,1562 'scheme':241,722 'script':474,515,523,529,758,823,1572,1716 'secret':880 'secur':1664 'see':228,687,1263,1366,1534,1555 'semant':1335,1512 'sensit':1674,1698 'server':784 'session':100,1033,1221 'session.created':1479 'session.idle':1478 'sessionend':103,170 'sessionstart':102,169,1289 'sessionstart/end':818 'set':172,192,205,268,553,1133 'settings.json':272 'setup':168 'shell':465,1402 'show':595 'shown':653,990,1006,1038,1045,1660 'silent':259,662,744,959,980,1232 'simpl':469,500,548,1647 'singl':508 'six':1286 'skill':321,1578 'skill-hooks-management' 'source-codealive-ai' 'specif':287,298,1677 'stabl':1283 'standalon':1708 'starlark':1352 'startup':87 'static':1360 'statusmessag':1330 'stderr':1340,1659 'stdin':560 'stdout':202,591,941 'step':488 'still':1357 'stop':120,1294 'stopfailur':121,166,816 'subagents/tasks':122 'subagentstart':123,165,815 'subagentstop':124 'subscrib':1409 'success/allow':1642 'supabas':1150 'support':792,1285 'symptom':1233 'syntax':1582,1595 'system':1028 'take':81 'taskcomplet':126 'taskcreat':125 'teammateidl':127,167,817 'templat':453,530 'test':397,833,841,1706 'throw':1420,1450,1518 'timeout':467,1328,1686,1721,1723 'titl':926 'token':250,733,1107 'toml':1308,1318 'tool':109,148,222,290,339,343,459,748,776,779,800,838,935,1020,1052,1063,1203,1425,1440,1495,1506 'tool.execute':1488 'tool.execute.after':1477 'tool.execute.before':1419,1476 'tool_input.command':504,568,856,1143 'tool_input.file':875,900 'topic-agent-safety' 'topic-agent-skills' 'topic-ai-coding' 'topic-ai-driven-development' 'topic-ai-safety' 'topic-antigravity' 'topic-bash' 'topic-claude-code' 'topic-codex-cli' 'topic-cursor' 'topic-developer-tools' 'topic-gemini-cli' 'total':1484 'translat':349 'tri':716 'trigger':28,210,676,1693 'troubleshoot':1690 'true':270,908,1313 'ts':903,1463,1466 'type':144,462,760,766,851,870,894,915,1323,1430,1566,1585 'typescript':1427 'typescript/javascript':1406 'ui':421,684,710,1005,1527 'understand':275 'unless':438 'updat':24 'update/modify':301 'updatedinput':1050 'url':774 'use':16,337,534,757,947,974,1358,1398,1497,1639 'user':18,70,105,175,215,281,355,447,586,604,636,686,704,966,996,1008,1041,1066,1075 'user-wid':174 'userpromptexpans':108 'userpromptsubmit':107,1290 'ux':257,737 'v0.124.0':1277 'v1.14.x':1395,1487 'valid':26,45,305,311,316,1569,1571,1580,1587,1593,1632,1682 'var':244,725,1102 'verbos':1662 'verifi':798,1669 'via':1023 'vs':470,1197 'want':19,282 'whenev':953 'wide':176 'without':1090 'workaround':718 'workflow':273 'worktre':135 'worktreecr':136 'worktreecreate/remove':164,814 'worktreeremov':137 'write':313,342,375,384,403,868,892,906 'x':426,830,1013,1085,1720 'y':1089","prices":[{"id":"57bada57-1659-4ada-9c60-30ed372eb172","listingId":"4a97e030-85d2-43f7-98d9-6df1d821b9b6","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"CodeAlive-AI","category":"ai-driven-development","install_from":"skills.sh"},"createdAt":"2026-05-04T06:56:23.196Z"}],"sources":[{"listingId":"4a97e030-85d2-43f7-98d9-6df1d821b9b6","source":"github","sourceId":"CodeAlive-AI/ai-driven-development/hooks-management","sourceUrl":"https://github.com/CodeAlive-AI/ai-driven-development/tree/main/skills/hooks-management","isPrimary":false,"firstSeenAt":"2026-05-04T06:56:23.196Z","lastSeenAt":"2026-05-18T18:57:06.594Z"}],"details":{"listingId":"4a97e030-85d2-43f7-98d9-6df1d821b9b6","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"CodeAlive-AI","slug":"hooks-management","github":{"repo":"CodeAlive-AI/ai-driven-development","stars":67,"topics":["agent-safety","agent-skills","ai-coding","ai-driven-development","ai-safety","antigravity","bash","claude-code","codex-cli","cursor","developer-tools","gemini-cli","hooks","mcp","multi-agent","opencode","plugins","prompt-engineering","skills","subagents"],"license":"mit","html_url":"https://github.com/CodeAlive-AI/ai-driven-development","pushed_at":"2026-05-12T20:04:46Z","description":"Practices, protocols, and skills for AI-driven software development. 18 skills + 1 Bash safety hook for Claude Code, Codex CLI, OpenCode, Cursor, Gemini CLI, Antigravity, and any agent supporting the Agent Skills standard.","skill_md_sha":"49ee61e138f078e3a57cf89bbfba7795cb228db8","skill_md_path":"skills/hooks-management/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/CodeAlive-AI/ai-driven-development/tree/main/skills/hooks-management"},"layout":"multi","source":"github","category":"ai-driven-development","frontmatter":{"name":"hooks-management","description":"Manage hooks and automation for coding agents (Claude Code, Codex CLI, OpenCode). Use when users want to add, list, remove, update, or validate hooks. Triggers on requests like \"add a hook\", \"create a hook that...\", \"list my hooks\", \"remove the hook\", \"validate hooks\", or any mention of automating agent behavior with shell commands or plugins."},"skills_sh_url":"https://skills.sh/CodeAlive-AI/ai-driven-development/hooks-management"},"updatedAt":"2026-05-18T18:57:06.594Z"}}