create-hook
Skill0 starsChanged 3 months agoMITView on GitHub
Codex hook authoring. Use when the user asks to create, update, audit, or verify Codex lifecycle hooks in global ~/.codex or project .codex scope, including hook scripts, hooks.json, matcher behavior, trust review, and smoke verification.
17 other projects use a version of this.
Adopted by
Most recently taken up by
- MacHatter1/bb-plugin-hookstheir own version, first seen Oct 25, 2026
- tony-hoang-ai-automation/mkt-skillstheir own version, first seen Oct 25, 2026
- pahlevikun/levistacktheir own version, first seen Oct 25, 2026
- ArangoGutierrez/claude-toolkittheir own version, first seen Oct 15, 2026
- 0mlkrizzz655335v/claude-skills-zhtheir own version, first seen Oct 15, 2026
- microsoft/vscodetheir own version, first seen Oct 13, 2026
Used with
Projects with it also use update-cli-config, review-bugbot and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
PandelisZSkillupdate-cli-config
View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.
Also in 6 projects that use this
0mlkrizzz655335vSkillreview-bugbot
缺陷导向代码审查。用 Bugbot 子代理找 bug。
Also in 4 projects that use this
32103210Skillmigrate-to-skills
Convert 'Applied intelligently' Cursor rules (.cursor/rules/*.mdc) and slash commands (.cursor/commands/*.md) to Agent Skills format (.cursor/skills/). Use when you want to migrate rules or commands to skills, convert .mdc rules to SKILL.md format, or consolidate commands into the skills directory.
Also in 6 projects that use this
32103210Skillupdate-cursor-settings
Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
Also in 6 projects that use this
Tsumugii24Skillsplit-to-prs
Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.
Also in 6 projects that use this
0mlkrizzz655335vSkillsdk
Codex SDK 集成开发。用 TypeScript/Python SDK 做 agent 生命周期、流式输出、本地/云端执行等集成。
Also in 5 projects that use this
- +2 more from 32103210
- +1 more from 0mlkrizzz655335v
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- microsoft/vscode★ 196ksame name
- am-will/codex-skills★ 1ksame name
- zhuangwenhui/CodingSkills★ 82same name
- KhaledSaeed18/dotclaude★ 7same name
- ArangoGutierrez/claude-toolkit★ 4same name
- MacHatter1/bb-plugin-hooks★ 4same name
- tony-hoang-ai-automation/mkt-skills★ 4same name
- 0mlkrizzz655335v/claude-skills-zh★ 2same name
- Iteam-company/claude-code-boilerplates★ 2same name
- Goodnessmbakara/codex-skills★ 1same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository160 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ab-testingSkill
- ad-creativeSkill
- adsSkill
- agent-reachSkill
- agents-sdkSkill
- ai-seoSkill
- analyticsSkill
- animation-vocabularySkill
- apk-reverseSkill
- apple-designSkill
- ask-sonnerSkill
- asoSkill
- ast-grepSkill
- audit-orchestratorSkill
- background-browser-operatorSkill
- better-colorsSkill
- better-typographySkill
- better-uiSkill
- binary-diffSkill
- brandkitSkill
- checkpoint-quality-loopSkill
- chronicleSkill
- churn-preventionSkill
- cline-orchestratorSkill
- cloudflare-email-serviceSkill
- cloudflareSkill
- codebase-designSkill
- codex-chatgpt-controlSkill
- codex-conductorSkill
- coding-agent-sessionsSkill
- cold-emailSkill
- co-marketingSkill
- community-marketingSkill
- compact-landingSkill
- competitor-profilingSkill
- competitorsSkill
- composio-cliSkill
- computer-useSkill
- content-strategySkill
- context7-mcpSkill
- copy-editingSkill
- copywritingSkill
- croSkill
- customer-researchSkill
- design-taste-frontendSkill
- design-taste-frontend-v1Skill
- diagram-generatorSkill
- diffui-designerSkill
- directory-submissionsSkill
- domain-modelingSkill
- durable-objectsSkill
- edr-bypass-reSkill
- emailsSkill
- emil-design-engSkill
- engineering-acceptance-reviewSkill
- extract-design-systemSkill
- find-animation-opportunitiesSkill
- find-skillsSkill
- firmware-pentestSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
36 rules. 0 are common, 16 are distinctive, and 20 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when the user wants Codex lifecycle hooks created, updated, audited, or verified.
- Distinctive: line 12
Start read-only. Inspect existing hook sources before changing files.
- Distinctive: line 13
Treat hooks as behavior-changing automation.
- Very specific: line 14
Prefer hooks.json for new hook config.
- Very specific: line 15
Use the current feature key: [features] hooks = true.
- Distinctive: line 16
Keep hook scripts deterministic, fast, and dependency-light.
- Distinctive: line 17
Never log secrets, raw credentials, private keys, tokens, full prompts, raw transcripts, or unredacted tool payloads unless the user …
- Distinctive: line 18
Do not install watchers, cron jobs, daemons, background agents, or model calls inside hook runtime.
- Very specific: line 23
Run python3 <skill>/scripts/audit_hooks.py --scope global for global hooks.
- Very specific: line 24
Run python3 <skill>/scripts/audit_hooks.py --scope project --repo <repo-root> for project hooks.
- Very specific: line 25
Read any reported hooks.json, inline [hooks], hook script folder, and feature flag state.
- Very specific: line 29
If the user says global, use ~/.codex.
- Very specific: line 30
If the user says project, resolve the repository root with git rev-parse --show-toplevel and use <repo>/.codex.
- Distinctive: line 31
If scope is missing and the behavior is personal across repos, default to global only if that is clearly implied.
- Very specific: line 32
If scope is still ambiguous, ask: Should this be global or project-scoped?
- Distinctive: line 35
If the event is missing or unclear, ask which hook event they want.
- Very specific: line 37
Ask for a matcher only for events that honor matchers: SessionStart, SubagentStart, PreToolUse, PermissionRequest, PostToolUse, PreCompact, …
- Very specific: line 38
Do not ask for a matcher for UserPromptSubmit or Stop.
- Distinctive: line 39
If the user wants multiple events, keep them as separate matcher groups and scripts unless shared code clearly reduces duplication.
- Distinctive: line 49
Write the hook config and script.
- Very specific: line 52
Use an explicit command path.
- Very specific: line 57
Use statusMessage only for short visible signals like Checking Bash command or Recording hook event.
- Distinctive: line 59
Use the correct output contract.
- Very specific: line 60
Read references/hook-contracts.md before writing event-specific output.
- Distinctive: line 69
Run the hook script with a minimal sample JSON payload for the chosen event.
- Distinctive: line 71
If project-scoped, confirm the repo is trusted or say that project hooks will not load until the project layer is trusted.
- Distinctive: line 73
Verify Codex trust and runtime behavior.
- Distinctive: line 75
Do not claim live hook execution until a trusted hook has actually fired.
- Distinctive: line 76
If live triggering is not possible in the current session, close with: standalone validation passed, Codex trust/live trigger still pending.
- Very specific: line 80
Use PreToolUse for prevention before supported tool calls.
- Very specific: line 81
Use PermissionRequest for approval-policy automation around escalation requests.
- Very specific: line 82
Use PostToolUse for logging, review notes, formatting hints, or follow-up checks after supported tools.
- Very specific: line 83
Use UserPromptSubmit for prompt shaping or context injection.
- Very specific: line 84
Use SessionStart for startup context.
- Very specific: line 85
Use PreCompact and PostCompact for compacting workflows.
- Very specific: line 86
Use Stop only for narrow end-of-turn continuation checks.
“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Hook
Use this skill when the user wants Codex lifecycle hooks created, updated, audited, or verified. Keep the loop tight: inspect current hook state first, write the smallest deterministic hook, validate it locally, and call out any trust or live-trigger step that remains.
Ground Rules
- Start read-only. Inspect existing hook sources before changing files.
- Treat hooks as behavior-changing automation. Blocking, rewriting, approval, prompt-shaping, or continuation hooks require explicit user intent.
- Prefer
hooks.jsonfor new hook config. If a layer already uses inline[hooks]inconfig.toml, preserve that representation instead of mixing formats unless the user asks to migrate. - Use the current feature key:
[features] hooks = true. Do not addcodex_hooks; it is deprecated. Do not add any feature flag when hooks are already enabled or unspecified. - Keep hook scripts deterministic, fast, and dependency-light. Default to Python stdlib, JSON stdin parsing, explicit timeout, and no network calls.
- Never log secrets, raw credentials, private keys, tokens, full prompts, raw transcripts, or unredacted tool payloads unless the user explicitly asks for a narrow local log and the script redacts sensitive values.
- Do not install watchers, cron jobs, daemons, background agents, or model calls inside hook runtime.
Workflow
- Audit the target.
- Run
python3 <skill>/scripts/audit_hooks.py --scope globalfor global hooks. - Run
python3 <skill>/scripts/audit_hooks.py --scope project --repo <repo-root>for project hooks. - Read any reported
hooks.json, inline[hooks], hook script folder, and feature flag state. - Completion criterion: you know the active layer, existing hook representation, whether hooks are disabled, and whether a same-event or same-script hook already exists.
- Run
- Determine scope.
- If the user says
global, use~/.codex. - If the user says
project, resolve the repository root withgit rev-parse --show-topleveland use<repo>/.codex. - If scope is missing and the behavior is personal across repos, default to global only if that is clearly implied.
- If scope is still ambiguous, ask:
Should this be global or project-scoped?
- If the user says
- Determine event and matcher.
- If the event is missing or unclear, ask which hook event they want.
- Supported events:
SessionStart,SubagentStart,PreToolUse,PermissionRequest,PostToolUse,PreCompact,PostCompact,UserPromptSubmit,SubagentStop,Stop. - Ask for a matcher only for events that honor matchers:
SessionStart,SubagentStart,PreToolUse,PermissionRequest,PostToolUse,PreCompact,PostCompact,SubagentStop. - Do not ask for a matcher for
UserPromptSubmitorStop; Codex ignores matchers for those events. - If the user wants multiple events, keep them as separate matcher groups and scripts unless shared code clearly reduces duplication.
- Determine behavior and risk.
- Logging or context-only hooks: proceed after behavior is clear.
- Blocking or denial hooks: confirm the exact deny condition and message.
PermissionRequesthooks: confirm whether the hook can allow, deny, or only log approval requests.- Rewriting hooks with
updatedInput: confirm the exact rewrite and keep it narrow. StoporSubagentStopcontinuation hooks: confirm the stopping condition so they cannot create a noisy loop.- Completion criterion: the trigger, allowed side effects, output contract, and failure mode are explicit.
- Write the hook config and script.
- Global config path:
~/.codex/hooks.json; scripts under~/.codex/hooks/. - Project config path:
<repo>/.codex/hooks.json; scripts under<repo>/.codex/hooks/. - Use an explicit command path. For project hooks, prefer git-root resolution:
/usr/bin/python3 "$(git rev-parse --show-toplevel)/.codex/hooks/<script>.py". - For global hooks, prefer an absolute home path:
/usr/bin/python3 "$HOME/.codex/hooks/<script>.py". - Set
timeoutexplicitly; use10seconds for simple log/context hooks and30seconds for validation hooks unless the user requests otherwise. - Use
statusMessageonly for short visible signals likeChecking Bash commandorRecording hook event.
- Global config path:
- Use the correct output contract.
- Read
references/hook-contracts.mdbefore writing event-specific output. - For
PreToolUsedenial, preferhookSpecificOutput.permissionDecision = "deny"withpermissionDecisionReason. - For
PermissionRequest, usehookSpecificOutput.decision.behaviorwithallowordeny. - For
UserPromptSubmit, plain stdout orhookSpecificOutput.additionalContextbecomes developer context. - For
Stop,decision: "block"means "continue the turn with this reason", not "reject the final answer".
- Read
- Validate locally.
- Compile Python scripts with
python3 -m py_compile <script>. - Parse
hooks.jsonwithpython3 -m json.tool <hooks.json>. - Run the hook script with a minimal sample JSON payload for the chosen event.
- Re-run the audit script and confirm the expected hook appears.
- If project-scoped, confirm the repo is trusted or say that project hooks will not load until the project layer is trusted.
- Compile Python scripts with
- Verify Codex trust and runtime behavior.
- Non-managed hooks must be reviewed and trusted in
/hooks; changed hook definitions get a new hash. - Do not claim live hook execution until a trusted hook has actually fired.
- If live triggering is not possible in the current session, close with: standalone validation passed, Codex trust/live trigger still pending.
- Non-managed hooks must be reviewed and trusted in
Practical Defaults
- Use
PreToolUsefor prevention before supported tool calls. - Use
PermissionRequestfor approval-policy automation around escalation requests. - Use
PostToolUsefor logging, review notes, formatting hints, or follow-up checks after supported tools. - Use
UserPromptSubmitfor prompt shaping or context injection. - Use
SessionStartfor startup context. - Use
PreCompactandPostCompactfor compacting workflows. - Use
Stoponly for narrow end-of-turn continuation checks.
Closeout
Report these states explicitly:
- Scope and paths changed.
- Event, matcher, script command, and timeout.
- Validation performed.
- Whether Codex trust review is still required.
- Whether behavior was validated live or only standalone.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

