Skip to content

Interactive wizard for building optimized, patched Codex binaries

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

johnzfitch/codex-xtreme

Repository files navigation

Codex Xtreme

Codex Xtreme

Interactive wizard for building optimized, patched Codex binaries

CI Status Powered by codex-patcher License


Overview

Codex Xtreme is a one-command wizard that builds a customized, optimized version of OpenAI's Codex CLI. It handles everything:

  • Detects your CPU and applies optimal compiler flags
  • Finds existing Codex repos or clones fresh
  • Applies privacy patches (removes telemetry)
  • Applies performance patches (optimized builds)
  • Builds with LTO, native CPU targeting, and more

Key Features

Feature Description
One Command Interactive wizard guides you through everything
Privacy First Removes Statsig telemetry and tracking
Optimized Builds CPU-native, LTO, mold linker support
Patch System Powered by codex-patcher
Beautiful CLI Clean, interactive UI with progress indicators

Quick Start

Installation

# Clone and build
git clone https://github.com/johnzfitch/codex-xtreme
cd codex-xtreme
cargo install --path .

# Or directly from GitHub
cargo install --git https://github.com/johnzfitch/codex-xtreme

Usage

# Run the wizard
codex-xtreme

# Developer mode (cherry-pick commits, extra options)
codex-xtreme --dev

Wizard Flow

The wizard guides you through these phases:

1. System Detection

Automatically detects:

  • CPU architecture (Zen 5, Intel Alder Lake, Apple Silicon, etc.)
  • Mold linker availability
  • Rust toolchain version

2. Repository Selection

  • Finds existing Codex repos in ~/dev/
  • Option to clone fresh from GitHub
  • Shows repo age and branch info

3. Cherry-Pick Commits (Dev Mode)

  • Lists commits since latest release
  • Multi-select commits to include
  • Automatically handles cherry-picking

4. Patch Selection

Choose from available patches:

Patch Description Default
privacy-patches Remove Statsig telemetry On
subagent-limit Increase to 8 parallel agents On
approvals-ui Simplified 4-preset approval system On
undo-command Re-enable /undo slash command On
cargo-config Linux x86_64 build optimizations Off

5. Build Configuration

  • Release profile selection (release, zack, etc.)
  • CPU target optimization
  • LTO and codegen units

6. Build & Install

  • Cargo build with progress streaming
  • Automatic installation to ~/.cargo/bin/
  • Summary of what was built

CLI Reference

codex-xtreme - Build your perfect Codex binary

Usage: codex-xtreme [OPTIONS]

Options:
  --dev, -d    Developer mode (cherry-pick commits, extra options)
  --help, -h   Show help message

Environment:
  RUST_LOG=debug    Enable debug logging

Privacy Patches

The default patches remove:

Component What's Removed
Statsig Telemetry All phone-home to ab.chatgpt.com
API Keys Hardcoded Statsig API keys
Exporter Config Telemetry exporter set to None

Your Codex binary will never contact external analytics services.


Performance Optimizations

When built with Codex Xtreme:

Optimization Effect
Native CPU Uses your exact CPU features
LTO (fat) Whole-program optimization
Single codegen unit Better optimization opportunities
Mold linker 5-10x faster linking (if available)
Panic abort Smaller binary, no unwinding
Strip symbols Reduced binary size

Typical results:

  • Build time: ~2-3 minutes (with mold)
  • Binary size: ~15-20 MB (stripped)
  • Performance: Up to 10-15% faster execution

Architecture

codex-xtreme
     │
     ├── System Detection
     │   ├── CPU target (rustc_version, cpuid)
     │   ├── Linker (mold detection)
     │   └── Toolchain (rustc version)
     │
     ├── Repository Management
     │   ├── Find existing repos (glob ~/dev/codex*)
     │   ├── Clone from GitHub
     │   └── Git operations (cherry-pick, etc.)
     │
     ├── Patch System (via codex-patcher)
     │   ├── Load patch definitions
     │   ├── Version filtering
     │   └── Apply patches
     │
     └── Build System
         ├── Cargo build with --message-format=json
         ├── Progress streaming
         └── Binary installation

Dependencies

Crate Purpose
codex-patcher Patch application
cliclack Interactive CLI UI
cargo_metadata Build output parsing
rustc_version Rust version detection

Development

Building

# Debug build
cargo build

# Release build
cargo build --release

# Run tests
cargo test

# Run clippy
cargo clippy --all-targets -- -D warnings

Project Structure

codex-xtreme/
├── src/
│   └── main.rs          # Complete wizard implementation
├── Cargo.toml           # Dependencies
├── docs/
│   └── patches.md       # Available patches documentation
└── .github/
    └── workflows/ci.yml # CI pipeline

Contributing

Contributions welcome! See CONTRIBUTING.md.

Adding New Patches

  1. Create patch definition in codex-patcher
  2. Add patch to the wizard's patch list in main.rs
  3. Test with codex-xtreme --dev

License

Licensed under either of:

at your option.


Related Projects


Build your perfect Codex, your way.

About

Interactive wizard for building optimized, patched Codex binaries

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages