Apps

Codex Temporary Files

Codex creates per-command temporary working files under .codex/tmp while it prepares prompts, unpacks attachments, stages generated patches, and streams intermediate JSON and log output between local helpers and the model runtime. These are short-lived scratch artifacts rather than account data, and they can accumulate when a command is interrupted, a terminal closes mid-run, or a plugin leaves behind extracted temp content. Kudu removes only the settled temporary files in .codex/tmp and intentionally leaves the separate plugin staging and backup area under .codex/.tmp alone, so your settings, history, credentials, and saved project files are not touched.

Why clean Codex Temporary Files?

  • Interrupted Codex runs can leave orphaned patch fragments, prompt payloads, and streamed response chunks behind, which shows up as .codex/tmp steadily growing even after the command finished
  • Stale extracted attachment files from an earlier command can be picked up by a retry or follow-up run, causing confusing references to old inputs or unexpectedly reused context
  • Leftover temporary JSON state and partial logs from a crashed session make troubleshooting harder because new failures get mixed with obsolete command output
  • Large abandoned scratch files from code generation or repository analysis can waste gigabytes of disk space, leading to low-space warnings during otherwise small Codex tasks
  • Temporary directories with old file handles or incomplete writes can trigger file-in-use or permission errors on the next run, especially after a forced terminal close
  • Cleaning settled temp files removes clutter from Codex's command workspace while preserving the separate .codex/.tmp plugin staging and backup area, so active plugin assets are not disturbed
What gets cleaned

Cache paths Kudu targets

Windows

~/.codex/tmp

macOS

~/.codex/tmp

Linux

~/.codex/tmp
Frequently asked

Common questions about Codex Temporary Files

Free & open source

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.