This is a fork of openai/codex maintained by Craft Docs for Craft Agents integration.
Craft Agents is a multi-backend AI assistant that supports both Anthropic Claude and OpenAI Codex. To provide consistent permission handling across backends, we needed hooks that don't exist in upstream Codex.
| Hook | Purpose |
|---|---|
item/toolCall/preExecute |
Pre-tool approval - Intercept ALL tool calls before execution, allowing the host app to approve/block/modify |
This enables:
- Unified permission system - Same permission behavior as Claude Agent SDK's
PreToolUsehook - Explore mode - Block write operations while allowing reads
- Source management - Block tools from inactive MCP sources with auto-activation support
- Path expansion - Modify tool inputs (e.g., expand
~to home directory)
# Clone this repo
git clone https://github.com/lukilabs/craft-agents-codex.git
cd craft-agents-codex
# Build (requires Rust)
cargo build --release
# Binary location
./target/release/codex# Set CODEX_PATH to use this fork
export CODEX_PATH=/path/to/craft-agents-codex/target/release/codexOr configure codexPath in your LLM connection settings.
We regularly sync with upstream openai/codex to incorporate new features and fixes.
# Sync from upstream (maintainers)
git fetch upstream
git merge upstream/mainFor general Codex CLI usage, see the upstream repo: