OpenAI Codex CLI Log Bug: Extreme SSD Wear and Actionable Fixes
A critical log bug in OpenAI Codex CLI versions before v0.142.0 caused excessive SSD wear—up to 640TB per year—due to hardcoded TRACE-level logging...
In June 2026, a critical bug in OpenAI's Codex CLI tool was uncovered, revealing a design flaw that could rapidly degrade users' SSDs. GitHub user 1996fanrui first reported the issue in GitHub Issue #28224, noting that the tool's log collector was writing diagnostic data at an alarming rate: 37TB over 21 days, translating to 640TB per year—exceeding the typical Total Bytes Written (TBW) rating of 600TB for a 1TB consumer SSD.
The root cause lay in a hardcoded setting in the Codex CLI's SQLite log collector. A line of Rust code set the default logging level to TRACE, the most detailed level, which records every internal action: WebSocket packet exchanges, inotify file system events (like opening system files such as ld.so.cache), OpenTelemetry telemetry mirrors (each conversation event generated three records), and internal states of the tokio-tungstenite async library. Compounding the problem, the SQLite collector ignored the standard RUST_LOG environment variable, leaving users unable to adjust the logging level manually.
Affected users spanned multiple platforms: Linux and macOS users (logs stored at ~/.codex/logs_2.sqlite) were the primary group, while Windows and WSL users (logs at %USERPROFILE%\.codex\) also faced issues but had fewer temporary fixes. The bug's impact correlated with usage intensity—heavy users running long Agent tasks or parallel tasks experienced higher write rates than casual users. All versions before v0.142.0 were vulnerable, with the issue first hinted at in GitHub Issue #17320 in April 2026. Symptoms included system slowdowns (some users reported being unable to type after long sessions), extreme log file bloat (up to 690GB), and crashes after 30–105 minutes of use.
OpenAI provided a permanent fix, but users had three actionable solutions:
1. **Upgrade to v0.142.0+ (Recommended)**: The definitive fix involves upgrading via `npm install -g @openai/codex@latest`. PRs #29432 and #29457, merged in v0.142.0, reduce log writes by ~85%. A follow-up PR #29599 is expected in v0.143.0 for further optimizations. After upgrading, users can check log growth with commands like `ls -lh ~/.codex/logs_2.sqlite` or monitor changes over 15 seconds.
2. **SQLite Trigger to Block Writes**: A temporary community solution from user @beskay blocks new log inserts. Steps: exit Codex, then run `sqlite3 ~/.codex/logs_2.sqlite "CREATE TRIGGER IF NOT EXISTS block_log_inserts BEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); END;"`. Note: This stops log writes but loses diagnostic data.
3. **Symlink to Memory (Linux/macOS)**: Redirect logs to /tmp (memory) to avoid SSD wear. Steps: exit Codex, backup logs (`mv ~/.codex/logs_2.sqlite ~/.codex/logs_2.sqlite.bak`), then create a symlink: `ln -s /tmp/codex_logs.sqlite ~/.codex/logs_2.sqlite`. The symlink needs recreation after restarting.
Windows/WSL users have no equivalent temporary fix—upgrading to v0.142.0+ is the best option, along with monitoring SSD health via SMART tools.
OpenAI's response was prompt: after the issue was raised on June 14, 2026, PRs #29432 and #29457 were merged on June 23, and v0.142.0 was released the same day, closing the original issue.
Sources
- SegmentFault Article: https://segmentfault.com/a/1190000048173775
- GitHub Issue #28224: Codex SQLite feedback logs can write ~640 TB/year and rapidly consume SSD endurance
- GitHub Issue #17320
- GitHub PR #29432
- GitHub PR #29457