codex-cli-hooks

Design Codex CLI hooks for SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, and Stop events.

8|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/narumiruna/skills --skill codex-cli-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-cli-hooks
Source: https://github.com/narumiruna/skills/tree/main/skills/deprecated/codex-cli-hooks
Command: npx skills add https://github.com/narumiruna/skills --skill codex-cli-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Codex CLI hooks enable safe, configurable control over Codex runtime behavior by intercepting events and applying policy before or after command execution.

Core Features & Use Cases

  • Guidance to enable feature flags and locate repo-local configurations, including config layers and hooks.json.
  • Step-by-step workflow to implement minimal event handlers for SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, and Stop.
  • Practical examples and references for testing, debugging, and auditing hook logic.

Quick Start

Create a minimal hook that loads startup context and proves the event contract for SessionStart.

Frequently Asked Questions about codex-cli-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Codex CLI hooks to intercept events?

Codex CLI hooks intercept runtime events by defining minimal handlers in hooks.json, applying policy before or after command execution across local and repo configurations to safely control behavior.

What events can I target when implementing hooks for Codex CLI?

Codex CLI hooks support SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, and Stop events, allowing you to guard and customize Codex behavior at specific execution lifecycle points.

How do I set up a minimal handler for the SessionStart hook?

A minimal SessionStart hook loads startup context and proves the event contract by defining a handler in hooks.json, following the payload schema and feature flag guidance to validate the configuration.

Where do I locate configuration files for Codex CLI hooks?

Codex CLI hooks configurations are located in repo-local config layers and hooks.json files, requiring feature flags to be enabled to activate the event interception and policy enforcement.

What is the best way to test and debug Codex CLI hooks?

Testing and debugging Codex CLI hooks involves auditing hook logic through practical examples and references, following workflow best practices to validate payload schemas and minimal handler patterns.