OpenAI Codex Logging Bug: Excessive SSD Writes and Workarounds

OpenAI Codex Logging Bug: Excessive SSD Writes and Workarounds

OpenAI Codex Logging Bug Causes Excessive SSD Wear

A critical bug in OpenAI Codex causes the application to write massive amounts of data—potentially terabytes—to local SSDs. This issue stems from the application shipping with trace/debug logging enabled by default, utilizing an unbounded SQLite database that lacks log rotation or capacity caps.

Technical Root Cause: Unbounded SQLite Trace Logs

The performance degradation and disk consumption are caused by a "firehose" of trace-level logs being written to a SQLite database. Because the logging system does not implement rotation or size limits, the log files grow indefinitely, consuming available disk space and increasing wear on SSD hardware.

Users have reported that this behavior can occur even when the application is idle. One user noted that running a VACUUM FULL command on their SQLite log file reduced the size from 27GB to 73MB, highlighting the extreme inefficiency of the current logging implementation.

Immediate Workarounds and Fixes

Until an official update is deployed, users can employ the following technical workarounds to prevent further disk writes:

SQLite Trigger Block

A temporary fix involves creating a SQLite trigger to block further inserts into the logs table. The following command can be executed against the Codex log database:

sqlite3 ~/.codex/logs_2.sqlite "CREATE TRIGGER IF NOT EXISTS block_log_inserts BEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); END;"

Filesystem Redirection

To prevent physical SSD wear, some users suggest symlinking the log directory to a tmpfs (RAM-backed filesystem), ensuring that logs are written to volatile memory rather than permanent storage.

Community Feedback and Performance Concerns

Beyond the logging bug, the community has highlighted several other stability and performance issues with Codex:

  • GPU Resource Exhaustion: Reports indicate that simply having the Codex window unhidden on macOS can cause 100% GPU usage due to the rendering of the "spinner" loading message.
  • Input Latency: Users have reported significant typing latency compared to competitors like Claude Code.
  • Cross-Tool Issues: Similar logging issues have been reported in other AI coding tools, with one user noting that Claude Code also writes massive debug logs to ~/.claude/logs.

Current Status

According to community reports, a fix has been committed to the Codex repository (commit e98d43ac372ddf7f513c0...) and is expected to be included in the next official release. Users are encouraged to monitor the official GitHub repository for the update.

Sources