If you're running OpenAI's Codex CLI locally, your SSD might be eating itself alive right now—and you'd have no idea until it's too late. A confirmed bug in certain Codex configurations leaves verbose debug logging enabled by default while enforcing zero log rotation or size caps. For developers spinning up agentic workflows—automated code review pipelines, continuous refactoring agents, long-horizon planning tasks—that translates to gigabytes of logs written per hour, and terabytes over days.
What's Actually Happening Under the Hood
The root cause is twofold: debug-level logging gets baked into certain deployment configurations where it shouldn't be, capturing every token processed, every tool invocation, and every intermediate reasoning step in excruciating detail. Meanwhile, there's no mechanism to cap file growth or rotate logs once they hit a threshold. The result? Your ~/.codex/logs/ directory becomes a black hole for storage. This isn't theoretical edge-case stuff—developers on the GitHub issue tracker are reporting log directories ballooning to hundreds of gigabytes within hours.
Who's Most at Risk
Not all Codex users face equal exposure. Configuration matters: Codex CLI v0.x running in local agent mode sits at high risk due to default debug logging, while VS Code extensions and containerized environments carry medium risk with more contained blast radii. Cloud-only API usage? You're clear—the runaway writes happen client-side, not on OpenAI's servers. The workloads you should be sweating are automated agents running for hours or days without human checkpoints, CI/CD pipelines with Codex integration doing continuous code generation, and any hybrid setup combining local inference with Codex where both model logs and agent logs pile up simultaneously.
How to Check Your System Right Now
Fire up your terminal and run the equivalent of du -sh ~/.codex/logs/ on Linux/macOS or the PowerShell command listed in official docs for Windows. If you're seeing gigabytes from recent sessions, you're already affected. Before you touch anything else, verify SSD health with CrystalDiskInfo on Windows or sudo nvme smart-log /dev/nvme0 on Linux—check that "Percentage Used" attribute hasn't spiked and cross-reference your "Data Units Written" against your drive's TBW rating. Consumer NVMe drives typically handle 300-600TB total writes over their lifetime; a runaway process burning through 1-2TB daily can meaningfully chew through that budget in weeks.
Fix It Today
First, stop any running Codex processes with pkill -f codex (Linux/macOS) or the equivalent Windows command, then nuke those logs to reclaim space. Next, crack open your config file—typically ~/.codex/config.json—and explicitly set logging level to "warn" with maxFileSizeMB and maxFiles constraints. If your version predates these fields, fall back to environment variables: export CODEX_LOG_LEVEL=warn. Then update to the latest patched release via npm update -g @openai/codex or pip install --upgrade openai-codex and verify with codex --version. Finally, layer on OS-level log rotation as a safety net—create a /etc/logrotate.d/codex entry that enforces daily rotation with size limits. This catches future bugs before they become disasters.
The Bigger Pattern Here
This Codex bug is symptomatic of how AI developer tooling ships fast and thinks about infrastructure later. Local LLM runners caching model outputs without caps, AI coding assistants maintaining unbounded context files, agent frameworks logging every intermediate step for "observability" while forgetting to actually rotate those logs—I've seen this pattern repeat across the ecosystem since the agentic AI boom kicked off around 2024. The takeaway isn't just patching Codex today; it's treating any AI tool running in loops or automation as a potential resource hog until proven otherwise, auditing disk usage after first runs, and setting resource limits before going to production.
Key Takeaways
- The bug silently writes TBs of debug logs when verbose logging is enabled without rotation caps
- Agentic workflows, CI/CD pipelines, and long-running sessions face the highest risk
- Check ~/.codex/logs/ immediately—gigabytes from recent sessions means you're affected
- Patch via npm update -g @openai/codex or pip install --upgrade openai-codex
- Set log level to "warn" in your config and enforce maxFileSizeMB limits
- Layer OS-level log rotation as a backstop against future runaway logging bugs
The Bottom Line
This is the kind of silent infrastructure killer that bites you on a Friday night when you're deep into debugging something else. OpenAI shipped fast and skipped the boring ops stuff—log management, resource limits—and now developers are paying for it with their SSD endurance. Audit your systems today, patch immediately, and for the love of everything: set up log rotation. It's not optional anymore.