create-hook
Create or update Codex hooks for global or project scope by asking for scope and hook type when ambiguous, then writing the hook config, scripts, and any required feature flag config.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o create-hook.zip https://jpskill.com/download/22312.zip && unzip -o create-hook.zip && rm create-hook.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22312.zip -OutFile "$d\create-hook.zip"; Expand-Archive "$d\create-hook.zip" -DestinationPath $d -Force; ri "$d\create-hook.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
create-hook.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
create-hookフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
フックを作成する
ユーザーがCodexフックを追加し、希望する動作を説明したい場合に使用します。
ワークフロー
-
スコープを決定します。
- ユーザーが
globalと言った場合は、個人/ホームスコープを使用します。 - ユーザーが
projectと言った場合は、リポジトリスコープを使用します。 - スコープが不明確な場合、または指定されていない場合は、
これはグローバルスコープとプロジェクトスコープのどちらにすべきですか?と尋ねます。
- ユーザーが
-
フックの種類を決定します。
- イベントが不明確な場合、または指定されていない場合は、どのフックを希望するか尋ねます。
SessionStartUserPromptSubmitPreToolUsePostToolUseStop
- ユーザーが複数のフックを希望する場合は、明示的に共有動作を希望しない限り、それぞれを個別に扱います。
- イベントが不明確な場合、または指定されていない場合は、どのフックを希望するか尋ねます。
-
動作を決定します。
- 意図がまだ明確でない場合は、フックが何をすべきか尋ねます。
- リクエストを満たす最小限の決定論的スクリプトを優先します。
-
選択したスコープにフックファイルを作成します。
- グローバル:
~/.codex/hooks.jsonおよび~/.codex/hooks/ - プロジェクト:
<repo>/.codex/hooks.jsonおよび<repo>/.codex/hooks/ - スクリプトパスは、可能な限り明示的かつ相対的に保ちます。
- グローバル:
-
ターゲットのCodexビルドがまだフックをゲートしている場合は、機能フラグを有効にします。
- 関連する
config.tomlで[features] codex_hooks = trueを設定します。
- 関連する
-
フックの出力を明確に保ちます。
- 短い可視信号には
statusMessageを使用します。 - ロギングフックの場合、リポジトリローカルまたはホームローカルのログファイルに書き込みます。
- ブロッキングフックの場合、フックが実際にツールを停止すべき場合にのみ、ゼロ以外の終了コードを返します。
- 短い可視信号には
-
結果を確認します。
- フックをトリガーするはずのコマンドを実行します。
- ログ、出力、またはブロッキング動作が、要求されたスコープとイベントに一致することを確認します。
実用的なデフォルト
- 予防には
PreToolUseを使用します。 - ロギング、フォーマット、またはテストのフォローアップには
PostToolUseを使用します。 - プロンプトの整形や注入されたコンテキストには
UserPromptSubmitを使用します。 - 起動時のコンテキストには
SessionStartを使用します。 - ターンの終了チェックには
Stopを使用します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Create Hook
Use when the user wants to add Codex hooks and explains the behavior they want.
Workflow
-
Determine scope.
- If the user says
global, use the personal/home scope. - If the user says
project, use the repo scope. - If scope is missing or unclear, ask:
Should this be global or project-scoped?
- If the user says
-
Determine hook type.
- If the event is missing or unclear, ask which hook they want:
SessionStartUserPromptSubmitPreToolUsePostToolUseStop
- If the user wants more than one, keep them separate unless they explicitly want shared behavior.
- If the event is missing or unclear, ask which hook they want:
-
Determine behavior.
- Ask what the hook should do if the intent is not already clear.
- Prefer the smallest deterministic script that satisfies the request.
-
Write the hook files in the chosen scope.
- Global:
~/.codex/hooks.jsonand~/.codex/hooks/ - Project:
<repo>/.codex/hooks.jsonand<repo>/.codex/hooks/ - Keep script paths explicit and relative where practical.
- Global:
-
Enable the feature flag if the target Codex build still gates hooks.
- Set
[features] codex_hooks = truein the relevantconfig.toml.
- Set
-
Keep the hook output clear.
- Use
statusMessagefor a short visible signal. - For logging hooks, write to a repo-local or home-local log file.
- For blocking hooks, return a nonzero exit only when the hook should actually stop the tool.
- Use
-
Verify the result.
- Run a command that should trigger the hook.
- Confirm the log, output, or blocking behavior matches the requested scope and event.
Practical defaults
- Use
PreToolUsefor prevention. - Use
PostToolUsefor logging, formatting, or test follow-up. - Use
UserPromptSubmitfor prompt shaping and injected context. - Use
SessionStartfor startup context. - Use
Stopfor end-of-turn checks.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (2,076 bytes)
- 📎 references/hook-scope.md (617 bytes)