Codex writes SQLite logs, threatens SSD endurance
In a GitHub issue filed on June 14, 2026 (openai/codex #28224), a user reported that the Codex CLI continuously writes large SQLite feedback logs to ~/.codex/logs_2.sqlite, ~/.codex/logs_2.sqlite-wal, and ~/.codex/logs_2.sqlite-shm. The reporter measured about 37 TB written to their main SSD after roughly 21 days of uptime, extrapolating to roughly 640 TB/year - roughly 640 full-drive writes per year on a 1 TB SSD, compared to many consumer drives rated near 600 TBW. The root cause identified in the issue is a global TRACE-level default for the SQLite feedback log sink, which captures dependency internals, raw WebSocket/SSE payloads, and OpenTelemetry mirror events. A 15-second sample showed ~36,211 rows inserted while retained count stayed flat, confirming a continuous insert-and-prune write amplification pattern. At least eight related issues on the repository document the same logging pattern across Codex Desktop and CLI.
What happened
In issue #28224 on the openai/codex GitHub repository (opened June 14, 2026), a user reported that the Codex CLI is continuously writing large amounts of data to the local SQLite feedback log database, specifically to ~/.codex/logs_2.sqlite, ~/.codex/logs_2.sqlite-wal, and ~/.codex/logs_2.sqlite-shm. The reporter measured approximately 37 TB of writes on their main SSD after about 21 days of uptime, extrapolating to roughly 640 TB/year - equivalent to about 640 full-drive writes per year on a 1 TB SSD, compared to common consumer endurance ratings near 600 TBW.
Root cause
The issue identifies the SQLite feedback log sink as installed with a global TRACE-level default: Targets::new().with_default(Level::TRACE). This persists all targets at TRACE level by default, including dependency internals (tokio-tungstenite, hyper_util, inotify events), raw WebSocket/SSE payload bodies, and OpenTelemetry mirror events (codex_otel.log_only, codex_otel.trace_safe). TRACE-level entries account for roughly 70.7% of retained bytes in the sample; adding the two otel mirror targets brings the share to around 96% of retained log bytes that could theoretically be dropped without disabling feedback logs entirely.
Write amplification mechanism
A 15-second sample showed approximately 36,211 rows inserted while the retained row count stayed flat, confirming a continuous insert-and-prune cycle: rows are written to the WAL, indexed, then pruned - generating ongoing write I/O proportional to the logging rate regardless of the final database size on disk.
Systemic pattern
The issue links at least eight related reports on the same repository documenting the same logging behavior across Codex Desktop and CLI builds, including #17320 (excessive WAL writes during streaming), #24275 (Desktop SQLite growth during normal use), #22444 (WAL grows indefinitely when stale processes hold the file open), and #27911 (goals_1.sqlite write amplification at ~11 MB/s).
Proposed fix (per issue)
Narrow what is persisted by default - drop the global TRACE default, suppress low-value dependency noise, avoid storing full raw WebSocket/SSE payloads, and add a global logs DB size/write cap. An opt-out flag (sqlite_logs_enabled = false) is suggested as an escape hatch but not the primary fix.
Editorial context
Persistent, high-volume local logging into a WAL-backed SQLite store can generate sustained write amplification via continuous checkpointing; this is a known risk pattern in long-running developer tooling and client-side agents. For practitioners, this is a reminder that client-side telemetry and feedback collection can carry real hardware costs on consumer SSDs with finite TBW ratings. Monitoring the openai/codex repository for fixes - such as configurable log levels, retention limits, or reduced-write telemetry backends - is advisable for anyone running Codex CLI long-term on consumer hardware.
Scoring Rationale
This issue documents a concrete, reproducible measurement with a clear root cause that affects any developer running Codex CLI long-term on consumer hardware. At least eight related issues confirm it is a systemic pattern across Codex Desktop and CLI builds, not a one-off report. It is notable for practitioners but limited in scope to a specific tooling defect, placing it in the mid-Solid range.
Practice interview problems based on real data
1,500+ SQL & Python problems across 15 industry datasets — the exact type of data you work with.
Try 250 free problems


