Codex Temporary Files
Codex writes per-command temporary working files under ~/.codex/tmp while it prepares prompts, stages generated patches, captures command output, and streams partial response artifacts between runs. That area can accumulate abandoned scratch directories, transient JSON payloads, diff fragments, log chunks, and incomplete download or extraction files after interrupted sessions or failed commands. Kudu removes only the settled temporary files in ~/.codex/tmp and leaves the separate .codex/.tmp plugin staging and backup area, along with your settings, accounts, and project data, untouched.
Why clean Codex Temporary Files?
- Interrupted Codex runs can leave orphaned scratch folders and partial patch artifacts behind, so disk usage keeps growing even though no active task is running
- Failed or cancelled commands may strand transient stdout and stderr log chunks in the temp area, which shows up as unexpectedly large ~/.codex storage on inspection
- Incomplete downloads or half-extracted helper assets in temporary directories can cause repeated retry loops or 'file already exists' style command errors on the next run
- Stale per-command JSON payloads and diff fragments can confuse resumed workflows, leading to duplicated output, patch-apply failures, or commands that appear to pick up old context
- Large numbers of settled temp files slow directory scans and cleanup passes, which users notice as a pause before Codex starts a new command or finishes housekeeping
- Crash leftovers from a previous session can make recovery logic revisit dead temporary state, causing warnings about abandoned workspaces or temporary file collisions until the cache is cleared
Cache paths Kudu targets
Windows
~/.codex/tmp |
macOS
~/.codex/tmp |
Linux
~/.codex/tmp |
Common questions about Codex Temporary Files
Download Kudu and reclaim your disk space.
Available on Windows, macOS, and Linux. No account required, no feature gates, no telemetry without consent. All cleaning targets are open source and community-auditable.