Interactive wizard for building optimized, patched Codex binaries
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
| Feature | Description |
|---|---|
| Interactive wizard guides you through everything | |
| Removes Statsig telemetry and tracking | |
| CPU-native, LTO, mold linker support | |
| Powered by codex-patcher | |
| Clean, interactive UI with progress indicators |
# 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# Run the wizard
codex-xtreme
# Developer mode (cherry-pick commits, extra options)
codex-xtreme --devThe wizard guides you through these phases:
Automatically detects:
- CPU architecture (Zen 5, Intel Alder Lake, Apple Silicon, etc.)
- Mold linker availability
- Rust toolchain version
- Finds existing Codex repos in
~/dev/ - Option to clone fresh from GitHub
- Shows repo age and branch info
- Lists commits since latest release
- Multi-select commits to include
- Automatically handles cherry-picking
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 |
- Release profile selection (release, zack, etc.)
- CPU target optimization
- LTO and codegen units
- Cargo build with progress streaming
- Automatic installation to
~/.cargo/bin/ - Summary of what was built
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
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.
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
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
| Crate | Purpose |
|---|---|
| codex-patcher | Patch application |
| cliclack | Interactive CLI UI |
| cargo_metadata | Build output parsing |
| rustc_version | Rust version detection |
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run clippy
cargo clippy --all-targets -- -D warningscodex-xtreme/
├── src/
│ └── main.rs # Complete wizard implementation
├── Cargo.toml # Dependencies
├── docs/
│ └── patches.md # Available patches documentation
└── .github/
└── workflows/ci.yml # CI pipeline
Contributions welcome! See CONTRIBUTING.md.
- Create patch definition in codex-patcher
- Add patch to the wizard's patch list in
main.rs - Test with
codex-xtreme --dev
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
- codex-patcher - The patching engine
- OpenAI Codex - The upstream CLI
Build your perfect Codex, your way.