What version of Codex CLI is running?
codex-cli 0.140.0
codex doctor reports 0.141.0 is available, but this was observed on 0.140.0.
Also observed locally:
codex-cli 0.140.0
codex-cli 0.138.0 # codext wrapper
What platform is your computer?
Linux x86_64, Ubuntu 24.04 noble.
Runtime/install from codex doctor:
Codex Doctor v0.140.0 · linux-x86_64
runtime: npm
Node path: ~/.nvm/versions/node/v24.13.0/...
terminal: Alacritty
auth: ChatGPT auth
Which model were you using?
gpt-5.5
What issue are you seeing?
Codex SQLite log WAL files are growing without bound into many GB/tens of GB during normal local use. The main symptom is enormous logs_2.sqlite-wal files, while the base logs_2.sqlite database remains comparatively small.
This appears to be a default Codex log/state behavior, not something caused by a custom log setting. My setup uses multiple CODEX_HOME profile directories (~/.codex-work and ~/.codex-personal) in addition to the default ~/.codex, but that only relocates Codex state. The default config in ~/.codex/config.toml has not changed any log or SQLite settings. It only contains a trusted project entry. No log_dir or sqlite_home override is configured there.
The Codex docs say local state is stored under CODEX_HOME, defaulting to ~/.codex, and mention logs/caches as per-user state. They also document optional log_dir and sqlite_home settings. So this should affect a standard ~/.codex setup the same way; the profile dirs here just made the issue easier to isolate.
Concrete evidence
Earlier in this session, before cleanup, the two active Codex profile/session folders had roughly 65 GB of SQLite log WAL files between them:
~/.codex-work/logs_2.sqlite-wal tens of GB
~/.codex-personal/logs_2.sqlite-wal tens of GB
combined log WAL sidecars about 65 GB
logs_2.sqlite-shm sidecars tens of MB
logs_2.sqlite base DB about 115,650,560 bytes per active profile
After deleting/moving aside WAL/SHM sidecars and restarting Codex, the WALs reappeared and began growing again. A later post-cleanup check showed:
/home/<user>/.codex-personal/logs_2.sqlite 115,650,560 bytes
/home/<user>/.codex-personal/logs_2.sqlite-wal 1,693,608,432 bytes
/home/<user>/.codex-personal/logs_2.sqlite-shm 3,309,568 bytes
/home/<user>/.codex-work/logs_2.sqlite 115,650,560 bytes
/home/<user>/.codex-work/logs_2.sqlite-wal 19,184,359,792 bytes
/home/<user>/.codex-work/logs_2.sqlite-shm 37,257,216 bytes
/home/<user>/.codex/logs_2.sqlite 14,266,368 bytes
/home/<user>/.codex/logs_2.sqlite-wal 8,207,072 bytes
/home/<user>/.codex/logs_2.sqlite-shm 32,768 bytes
At the same time, profile directory sizes were dominated by these SQLite sidecars:
~/.codex-work 23G
~/.codex-personal 2.8G
~/.codex 104M
codex doctor reported the log DB itself as healthy:
state: databases healthy
log DB ~/.codex-personal/logs_2.sqlite (file) · integrity ok
But it did not warn about the enormous WAL file.
Impact
- Normal backup/rsync of Codex state attempted to copy tens of GB of volatile SQLite WAL files.
- The huge WAL files consumed significant disk space and made simple profile synchronization unexpectedly expensive.
- Deleting the WAL while Codex processes are live does not actually reclaim disk until those processes exit because the file remains open.
- Attempting to truncate open deleted WAL file descriptors caused active Codex instances to crash immediately.
- The current workaround is to exclude
*.sqlite-wal and *.sqlite-shm from rsync/backup and only clean/checkpoint these files when Codex is not running.
Steps to reproduce
-
Use Codex CLI/app normally for an extended local coding session, especially with substantial tool output.
-
Inspect the Codex state directory:
find "$CODEX_HOME" -maxdepth 1 \( -name '*sqlite-wal' -o -name '*sqlite-shm' -o -name 'logs_2.sqlite' \) -printf '%p %s bytes\n' | sort
-
Compare logs_2.sqlite-wal size with logs_2.sqlite.
Expected result: WAL remains bounded, periodically checkpointed, or is truncated on clean shutdown.
Actual result: logs_2.sqlite-wal can grow into tens of GB while the base log DB remains around ~100 MB.
Expected behavior
- Codex should not allow
logs_2.sqlite-wal to grow without a practical bound.
- The logging/state layer should periodically checkpoint/truncate SQLite WAL files or configure WAL autocheckpointing appropriately.
- Large tool output should be capped, summarized, or rotated before it can accumulate unboundedly in persistent local log state.
codex doctor should warn when logs_2.sqlite-wal or other Codex SQLite sidecars exceed a reasonable threshold.
- Ideally, Codex should expose documented retention/size controls for local logs and SQLite-backed runtime state.
Related issues
This may be related to, but is more specific than:
This issue is specifically about unbounded logs_2.sqlite-wal growth under default-style Codex state behavior.
What version of Codex CLI is running?
codex-cli 0.140.0codex doctorreports0.141.0is available, but this was observed on0.140.0.Also observed locally:
What platform is your computer?
Linux x86_64, Ubuntu 24.04 noble.
Runtime/install from
codex doctor:Which model were you using?
gpt-5.5What issue are you seeing?
Codex SQLite log WAL files are growing without bound into many GB/tens of GB during normal local use. The main symptom is enormous
logs_2.sqlite-walfiles, while the baselogs_2.sqlitedatabase remains comparatively small.This appears to be a default Codex log/state behavior, not something caused by a custom log setting. My setup uses multiple
CODEX_HOMEprofile directories (~/.codex-workand~/.codex-personal) in addition to the default~/.codex, but that only relocates Codex state. The default config in~/.codex/config.tomlhas not changed any log or SQLite settings. It only contains a trusted project entry. Nolog_dirorsqlite_homeoverride is configured there.The Codex docs say local state is stored under
CODEX_HOME, defaulting to~/.codex, and mention logs/caches as per-user state. They also document optionallog_dirandsqlite_homesettings. So this should affect a standard~/.codexsetup the same way; the profile dirs here just made the issue easier to isolate.Concrete evidence
Earlier in this session, before cleanup, the two active Codex profile/session folders had roughly 65 GB of SQLite log WAL files between them:
After deleting/moving aside WAL/SHM sidecars and restarting Codex, the WALs reappeared and began growing again. A later post-cleanup check showed:
At the same time, profile directory sizes were dominated by these SQLite sidecars:
codex doctorreported the log DB itself as healthy:But it did not warn about the enormous WAL file.
Impact
*.sqlite-waland*.sqlite-shmfrom rsync/backup and only clean/checkpoint these files when Codex is not running.Steps to reproduce
Use Codex CLI/app normally for an extended local coding session, especially with substantial tool output.
Inspect the Codex state directory:
Compare
logs_2.sqlite-walsize withlogs_2.sqlite.Expected result: WAL remains bounded, periodically checkpointed, or is truncated on clean shutdown.
Actual result:
logs_2.sqlite-walcan grow into tens of GB while the base log DB remains around ~100 MB.Expected behavior
logs_2.sqlite-walto grow without a practical bound.codex doctorshould warn whenlogs_2.sqlite-walor other Codex SQLite sidecars exceed a reasonable threshold.Related issues
This may be related to, but is more specific than:
logs_2.sqlitecauses Desktop startup failures.codexprocesses. #20563, which reports heavy I/O from idle Codex processes.This issue is specifically about unbounded
logs_2.sqlite-walgrowth under default-style Codex state behavior.