Engineering & AI
PC slow when you open Codex? Start here
Is the Codex app slowing down your PC with frequent log writes? Check for disk bottlenecks, assess SSD wear, and filter SQLite logs to WARN and ERROR.
Summary
- A Windows machine running Codex 0.169.0 recorded 765 TRACE entries in the busiest minute of one sample.
- Frequent log writes can slow a PC if they saturate the drive. A substantial increase in total writes over time can also wear an SSD faster.
- RUST_LOG filters stderr output. The codex app-server SQLite database uses a separate filter.
- A SQLite trigger can limit new entries to WARN and ERROR. Verify it against the active database and remove it when you need detailed diagnostics.

Does saving a file slow down too?
If opening or saving a file takes longer while Codex is running, leave the app open and check the drive while the delay is still happening.
Check which files are being written
On Windows, press Win + R, enter resmon, then open Disk → Disk Activity. Look for logs_2.sqlite and logs_2.sqlite-wal. Compare their Write (B/sec) values with disk response time while saving a file.
- If Codex logs are being written continuously as disk response time rises, check the version and filtering steps below. The measurements came from a Windows machine running Codex CLI 0.169.0.
- If another process accounts for most writes while the logs are quiet, inspect that process first. If the slowdown has passed, repeat the check when it returns.
How log writes can slow down a file save
When Codex keeps writing to logs_2.sqlite-wal, other apps using the same drive may have to wait longer if the drive is already close to saturation. You might notice files opening or projects saving more slowly. Issue #29463 reports that the WAL kept updating after the Codex app restarted on Windows. The measurements in this guide count log rows and SQLite transactions. Assessing a slowdown requires measuring actual disk read and write latency. Windows log write report · Microsoft's guide to measuring disk latency
Can the Codex app damage an SSD?
SSDs have finite write endurance. Each additional write contributes to the total data the drive has to handle. If Codex logs substantially increase total writes over time, the SSD can wear faster. The manufacturer's TBW (terabytes written) rating helps assess write endurance for a given model. To estimate the impact on your PC, measure actual writes and check the drive's health counters. The count of 765 TRACE rows in one minute alone cannot establish that Codex damages an SSD. Kingston's explanation of write endurance and SMART
Issue #28224 reported a case where SQLite logs were the main source of sustained writes on one machine. The reporter closed the issue after Codex merged three changes that reduced logging. The report gives a reason to check write volume if the behavior recurs on your machine. Report and update in issue #28224
Codex still saves TRACE after you set RUST_LOG
Problem
codex app-server has one filter for stderr and another for SQLite. In 0.169.0, the stderr filter reads RUST_LOG, while the SQLite path calls log_db::default_filter(). That function defaults to TRACE, with exceptions for some log sources. Issue #29463 reports the same behavior on Windows. App-server source · SQLite log filter · Issue #29463
Evaluate
One SQLite transaction can save many log rows. In WAL mode, SQLite records changes in the -wal file and copies pages back into the main database at a checkpoint. To observe activity during a measurement window, include the WAL. SQLite WAL documentation
Over a 10-minute window on November 28, 2026, the Windows machine recorded 788 TRACE, 315 INFO, 215 DEBUG, and 30 WARN entries. The follow-up measurement tracked new rows and observed WAL transactions.
| Filter | Duration | WAL transactions | New rows |
|---|---|---|---|
| Drop DEBUG and TRACE | 60 seconds | 5 | 25 INFO |
| Just before dropping INFO as well | 60 seconds | 7 | 129 INFO, 3 WARN |
| Just after dropping INFO | 60 seconds | 0 | 0 |
| Follow-up with WARN and ERROR only | 5 minutes of light activity | 0 | 0 |
During the five-minute sample, two Codex processes used a combined 8.41 seconds of CPU time and the database recorded no new warnings or errors. Activity varied across the samples. The zero refers to observed WAL transactions during that light workload. The test grouped new row IDs by log level and sampled the WAL-index transaction counter roughly every 100 ms. Measuring bytes written to the SSD requires a separate I/O measurement.
Solution
- Save your work and quit Codex. Locate the
logs_2.sqlitefile Codex uses. The default directory is~/.codex/. If you changedCODEX_HOME,CODEX_SQLITE_HOME, orsqlite_home, confirm the actual path first. Codex configuration reference - In a terminal, open the confirmed file with
sqlite3 "path-to-logs_2.sqlite". In the SQLite shell, run.schema logsand confirm the table hasidandlevelcolumns. Run.backup "logs_2-before-filter.sqlite"to save a copy in the current directory before making changes. - In the same SQLite shell, add the trigger below. SQLite skips rows whose level falls outside
WARNandERRORat insert time. Existing rows stay in the database. SQLite documentation for triggers and RAISE(IGNORE)
CREATE TRIGGER IF NOT EXISTS user_keep_warn_error_logs
BEFORE INSERT ON logs
WHEN COALESCE(UPPER(NEW.level), '') NOT IN ('WARN', 'ERROR')
BEGIN
SELECT RAISE(IGNORE);
END;Check. Query SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = 'user_keep_warn_error_logs'; and compare the result with the definition above. Record SELECT COALESCE(MAX(id), 0) FROM logs;, then reopen Codex and run a short task. Reopen the same file with sqlite3 -readonly and run the following query, replacing 0 with the ID you recorded. Any new rows should be WARN or ERROR. An empty result means the sample contains no new rows.
SELECT level, COUNT(*) AS rows_saved
FROM logs
WHERE id > 0
GROUP BY level;Restore detailed logging
Quit Codex, reopen the same database with write access, and run DROP TRIGGER IF EXISTS user_keep_warn_error_logs;. If you already use a scheduled job to reapply the trigger, stop it before removing the trigger. The next run can save entries according to the default filter. Rows skipped earlier cannot be recovered from the database.
Is the PC actually faster now?
Repeat the same task for the same amount of time. Compare write activity, disk response time and how long the file takes to save. If logging drops but saves still take just as long, return to Disk Activity and check the other processes.
Preparing the AI agent
Provide your Codex version, the database path, and the task you want to measure. Ask the agent to check the schema before making changes, open only the confirmed log file, and use the same task and duration for both measurements. Codex 0.169.0 also reads persisted logs when preparing data for /feedback. Remove the trigger before reproducing an issue if you need to include detailed diagnostics. Log writes and feedback data in the source
Out of scope
These measurements come from one Windows machine running Codex 0.169.0. The trigger belongs to a specific SQLite file. After upgrading or if Codex creates a new database, check the version, path, and schema before applying it again. This method limits the rows SQLite stores. Codex can still generate and process log events before sending them to SQLite.
Terms in this article (3)
- Codex
- An AI coding tool. This guide examines the SQLite logging path in codex app-server.
- SQLite WAL
- A file that records database changes before a checkpoint copies pages back into the main database.
- SQLite trigger
- A rule that runs when data in a table changes. The trigger in this guide checks the log level before each insert.
Frequently asked questions
Why can I still see TRACE in logs_2.sqlite after adding the trigger?
Existing rows stay in place. If a TRACE row appears after the ID you recorded at installation time, verify that Codex uses the same SQLite file and that the trigger is still present in it.
Does zero WAL transactions mean the SSD wrote no data?
The sample showed zero observed WAL transactions from this log database over five minutes of light activity. Bytes written to the drive require a separate I/O measurement.
Sources
- Issue #29463 on TRACE in the Windows log database, OpenAI Codex GitHub
- Issue #28224 on write volume and SSD endurance, OpenAI Codex GitHub
- Measuring and troubleshooting Windows performance, Microsoft
- SSD write endurance and SMART health counters, Kingston
- Logging setup in app-server 0.169.0, OpenAI
- SQLite log filter in Codex 0.169.0, OpenAI
- Codex log batches and feedback data, OpenAI
- Codex configuration reference, OpenAI
- Write-Ahead Logging, SQLite
- CREATE TRIGGER and RAISE, SQLite