SafeDisk AI

Codex code_sign_clone Taking Disk Space On Mac

Codex Desktop can leave large code_sign_clone.* directories under /private/var/folders. Recent reports range from a few GB to 100GB+ on low-free-space Macs. Treat them as temporary app clones, but prove they are stale before deleting anything broader like sessions, projects, or app support data.

AI storage deletion judgment

Find what the AI tool can delete.

Copy the read-only check first. If the output still needs judgment, leave your email and we send the free SafeDisk AI deletion trial step only when the agent cache or session state needs review.

Add command output optional

Free trial step. We reply first with a delete / confirm / protect judgment or one read-only detail we still need.

See sample result Ask AI about one file

Read-only confirmation

First measure the clone tree, the largest clone bundles, and whether Codex or helper processes still have files open there.

root=$(find /private/var/folders -path "*/X/com.openai.codex.code_sign_clone" -type d 2>/dev/null | head -1)
echo "clone root: ${root:-not found}"

if [ -n "$root" ]; then
  du -sh "$root" 2>/dev/null
  find "$root" -maxdepth 1 -type d -name "code_sign_clone.*" 2>/dev/null | wc -l
  find "$root" -maxdepth 3 -type d -name "Codex.app.bundle" -print0 2>/dev/null \
    | xargs -0 du -sh 2>/dev/null \
    | sort -h \
    | tail -20
  lsof +D "$root" 2>/dev/null | head -40
fi

Usually safe boundary

The code_sign_clone.* folders are temporary app clone directories, not your project code or Codex conversation history. The safer boundary is narrow:

Cron and read-only workaround guardrails

If you automate cleanup while waiting for an upstream fix, keep the workaround reversible. Avoid making the clone parent, Crashpad folders, ~/.codex, or app support directories permanently read-only; that can break future launch, update, crash reporting, or diagnostic behavior.

Do not delete first

Careful cleanup

Keep the newest clone group, move older clones to Trash.

Run this only after Codex is quit and the read-only check shows no open files under the clone root. It keeps every clone tied for newest birth time, then moves only older clone directories.

osascript -e 'quit app "Codex"' 2>/dev/null || true
root=$(find /private/var/folders -path "*/X/com.openai.codex.code_sign_clone" -type d 2>/dev/null | head -1)
trash="$HOME/.Trash/SafeDisk-Codex-code-sign-clone"

if [ -z "$root" ] || lsof +D "$root" 2>/dev/null | grep -q .; then
  echo "Codex clone root missing or still in use; do not move it yet."
  exit 0
fi

tmp=$(mktemp)
find "$root" -maxdepth 1 -type d -name "code_sign_clone.*" -print0 2>/dev/null \
  | while IFS= read -r -d '' dir; do
      printf "%s\t%s\n" "$(stat -f '%B' "$dir" 2>/dev/null || echo 0)" "$dir"
    done \
  | sort -k1,1nr > "$tmp"

[ -s "$tmp" ] || { echo "No clone directories found."; rm -f "$tmp"; exit 0; }
keep_birth=$(head -1 "$tmp" | cut -f1)
mkdir -p "$trash"

while IFS=$'\t' read -r birth dir; do
  if [ "$birth" = "$keep_birth" ]; then
    echo "keep newest: $dir"
  else
    mv "$dir" "$trash/"
    echo "moved older clone: $dir"
  fi
done < "$tmp"

rm -f "$tmp"
du -sh "$trash" 2>/dev/null
Free AI deletion trial

Need a delete / confirm / protect answer for AI tool files?

Submit the form first; the command output or one-line agent storage symptom can follow. We check whether free guidance is enough before asking for the free SafeDisk AI deletion trial.

Add output optional

Start with email. Output can follow after the first reply.