Break Codex's infinite read → compact → reread loop on long-running tasks.
Codex's built-in compaction
Shortened history → Omitted details → Reread files and reconstruct decisions → Compact again
→ Tasks that outlast the interval between compactions enter an infinite loop
Codex Compressor
Handoff → Fresh context window → Resume from the exact next action
- Creates a visible cumulative handoff while the active agent still has the full context.
- Validates, saves, and reinjects the handoff through hooks.
- Starts the new window with context headroom and resumes from the exact next action.
⭐ Star Codex Compressor on GitHub
Requirements: Python 3.11 or later · Windows, macOS, or Linux · standalone installation or local Codex plugin
macOS and Linux:
git clone https://github.com/hehee9/codex-compressor.git
cd codex-compressor
./install.sh install --mode standaloneWindows PowerShell:
git clone https://github.com/hehee9/codex-compressor.git
Set-Location codex-compressor
.\install.ps1 install --mode standaloneRegister the cloned repository as a local marketplace and install the plugin:
codex plugin marketplace add .
codex plugin add codex-compressor@codex-compressor-local
Complete the plugin setup:
# macOS and Linux
./install.sh install --mode plugin# Windows PowerShell
.\install.ps1 install --mode pluginOpen /hooks in Codex, approve the codex-compressor hooks, and start a new session.
macOS and Linux:
./install.sh status
./install.sh doctor
./install.sh uninstallWindows PowerShell:
.\install.ps1 status
.\install.ps1 doctor
.\install.ps1 uninstallLicensed under the Apache License 2.0. Copyright 2026 hehee9.
