You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] macOS app leaves code_sign_clone directories after quit (~965MB per launch) #25667
Each clone is about 965 MB. After launching/quitting Codex multiple times, these directories keep accumulating. On my machine after several app restarts:
The directories disappear after reboot because macOS cleans the /var/folders/.../X temp area.
This looks related to Chromium's MacAppCodeSignClone / code_sign_clone mechanism. Clone creation itself may be expected, but inactive clone dirs are not cleaned up after the app quits. I also observed orphaned helper processes after quitting Codex, including multiple browser_crashpad_handler processes and SkyComputerUseService processes with PPID=1.
What steps can reproduce the bug?
Launch /Applications/Codex.app.
Quit Codex.app.
Check the clone directory:
find /private/var/folders/*/*/X/com.openai.codex.code_sign_clone -maxdepth 1 -type d -name 'code_sign_clone.*'2>/dev/null | wc -l
du -sh /private/var/folders/*/*/X/com.openai.codex.code_sign_clone 2>/dev/null
pgrep -fl 'Codex|node_repl|SkyComputerUse|app-server|browser_crashpad_handler'
Repeat launch/quit several times.
Observed: each launch creates another code_sign_clone.* directory, and old inactive clone dirs remain after quitting.
What is the expected behavior?
After Codex quits, inactive code_sign_clone.* directories should be removed by the code-sign-clone cleanup helper. Repeated launch/quit cycles should not keep adding ~965 MB per launch until reboot.
Additional information
I checked that this does not appear to be caused by my Codex config.toml. The issue appears to be in the macOS app / Chromium app lifecycle cleanup.
The active clone may be held by the running Codex process, but old clone directories were not held by open file handles when checked with lsof +D. This suggests cleanup is not being triggered or is not completing for inactive clones.
Per-clone size: about 943M-962M, roughly matching the installed Codex.app bundle size
Stale clones spanned multiple Codex app builds (26.527.*, 26.601.*, 26.602.*) and Chromium framework versions (148.0.7778.179, 149.0.7827.54)
No open file handles under com.openai.codex.code_sign_clone were found with lsof at the time of inspection
This supports the existing diagnosis that inactive macOS Chromium code-sign clone directories are accumulating across launches/updates and are only reclaimed when macOS clears /var/folders/.../X on reboot. The impact can be material on low-free-space machines: in this case the stale Codex clone directory was several GB and large enough to contribute to unrelated Docker failures from low disk headroom.
No machine-specific temp token, username, workspace path, process ID, or session identifier is included here.
/private/var/folders was taking about 17GB, and almost all of it came from com.openai.codex.code_sign_clone.
I also checked with lsof, and no open file handles were found under com.openai.codex.code_sign_clone at the time of inspection.
This seems to support the existing diagnosis that inactive macOS code-sign clone directories are accumulating across launches/updates and are not being cleaned up promptly.
The impact can be significant on low-free-space machines, since the stale Codex clone directory alone took about 16GB in my case.
No machine-specific temp token, username, workspace path, process ID, or session identifier is included here.
App Cleaner also attributed the Codex app removal set to roughly 153G / 42.5K items. The bulk was not ~/Library/Application Support/Codex, ~/.codex, or the app bundle itself; it was the X/com.openai.codex.code_sign_clone tree.
A size-ranked scan showed the stale clone tree dominating all Codex/OpenAI-named paths:
So in this case, 103 stale clones accounted for roughly 128G of reclaimable space. The current running process needed only one clone. This strongly suggests the cleanup path for inactive macOS code-sign clones is still not running reliably after Codex launches/updates/quits.
This is especially painful because GUI uninstall/cleaner tools surface it as Codex taking 150GB+, and using those tools risks deleting unrelated Codex data/projects unless the user manually inspects the paths.
No machine-specific temp token, username, workspace path, or session identifier is included here.
The 125-130GB confirmations make this worth splitting into two tracks: safe user cleanup and product-side retention.
From the reports here, the large tree appears to be temporary macOS app clones under /private/var/folders/.../X/com.openai.codex.code_sign_clone, not ~/.codex, project workspaces, or normal Codex app support state. I would avoid broad app-cleaner deletion until the clone root is measured separately.
A low-risk evidence block for affected users:
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
For cleanup, the narrow boundary I would use is: quit Codex, confirm lsof +D "$root" is empty, then move only code_sign_clone.* directories to Trash. Do not delete ~/.codex, workspaces, session files, credentials, or the whole app support folder as part of this workaround.
For the product fix, useful acceptance checks might be:
after N launch/quit cycles, inactive code_sign_clone.* dirs return to zero or a bounded count;
old clone dirs are removed when helper processes exit;
a startup self-check can warn if the clone tree exceeds a threshold like 5GB/10GB;
the app exposes the clone root in diagnostics without asking users to reveal private path segments.
It keeps the newest birth-time group in each Codex temp parent and deletes only strictly older code_sign_clone.* directories. If multiple clone dirs have the same newest birth time, I keep all of them instead of guessing which one is safest to remove.
I tested it against the real leaked directories on my machine. With three clone dirs present, it kept the newest one and removed the older two. A later dry run with one remaining clone dir reported that it would keep it.
Small safety note on the cron/read-only workarounds above:
The clone path here does look like temporary app clone state, but I would keep any workaround reversible. I would not make the clone parent, Crashpad pending folder, ~/.codex, or the app support folders permanently read-only. That can hide the symptom while breaking future launches, updates, crash reporting, or diagnostics.
Guardrails I would add before running this unattended:
run in dry-run mode first and log clone count, moved bytes, and the newest group that was kept;
quit Codex first, then skip the whole parent if lsof +D "$root" returns anything;
add a minimum-age guard, e.g. only move clone dirs older than 6-24 hours;
move older clone dirs to Trash or a staging folder, not rm -rf directly;
keep clone cleanup separate from Crashpad deletion, session cleanup, or app-support cleanup.
The Codex clone directories have mtimes across June 16-24, 2026, with several created on June 22-24. This matches the report: repeated app launches leave inactive code_sign_clone.* directories behind instead of cleaning them up, and it can consume tens of GB without the user installing anything.
Can confirm this issue as well, I've had to clean up space on my Mac multiple times, and the Codex app is always one of the biggest offenders, taking up gigabytes due to this.
Can confirm. I started to cleanup my 512GB macbook constantly because of this. I delete these directories and they come back as 30-50-sometimes even 70 GB.
Activity
pungaa commentedon Jun 7, 2026
Additional sanitized confirmation from another macOS machine:
26.602.4072415.7.x/private/var/folders/<redacted>/<redacted>/X/com.openai.codex.code_sign_clone/code_sign_clone.<suffix>/Codex.app.bundle76.5G943M-962M, roughly matching the installedCodex.appbundle size26.527.*,26.601.*,26.602.*) and Chromium framework versions (148.0.7778.179,149.0.7827.54)com.openai.codex.code_sign_clonewere found withlsofat the time of inspectionThis supports the existing diagnosis that inactive macOS Chromium code-sign clone directories are accumulating across launches/updates and are only reclaimed when macOS clears
/var/folders/.../Xon reboot. The impact can be material on low-free-space machines: in this case the stale Codex clone directory was several GB and large enough to contribute to unrelated Docker failures from low disk headroom.No machine-specific temp token, username, workspace path, process ID, or session identifier is included here.
LZWcc commentedon Jun 16, 2026
Additional confirmation from another macOS machine:
Clone path pattern:
In my case, the stale clone directory grew to about 16GB:
The output of
dushows multiplecode_sign_clone.*directories, each containing a copiedCodex.app.bundle:/private/var/folderswas taking about 17GB, and almost all of it came fromcom.openai.codex.code_sign_clone.I also checked with
lsof, and no open file handles were found undercom.openai.codex.code_sign_cloneat the time of inspection.This seems to support the existing diagnosis that inactive macOS code-sign clone directories are accumulating across launches/updates and are not being cleaned up promptly.
The impact can be significant on low-free-space machines, since the stale Codex clone directory alone took about 16GB in my case.
No machine-specific temp token, username, workspace path, process ID, or session identifier is included here.
plxj6666 commentedon Jun 17, 2026
my file has grown up to 125GB!!!
VincentAdamNemessisX commentedon Jun 19, 2026
Additional confirmation from another macOS machine, this time with a much larger accumulation on a current Codex build.
Observed path pattern:
Disk usage before manual cleanup:
App Cleaner also attributed the Codex app removal set to roughly
153G/42.5Kitems. The bulk was not~/Library/Application Support/Codex,~/.codex, or the app bundle itself; it was theX/com.openai.codex.code_sign_clonetree.A size-ranked scan showed the stale clone tree dominating all Codex/OpenAI-named paths:
lsof +Dshowed only one currently active clone held by the running Codex process:I then removed the inactive clone directories while keeping the one active clone. After cleanup:
So in this case,
103stale clones accounted for roughly128Gof reclaimable space. The current running process needed only one clone. This strongly suggests the cleanup path for inactive macOS code-sign clones is still not running reliably after Codex launches/updates/quits.This is especially painful because GUI uninstall/cleaner tools surface it as Codex taking 150GB+, and using those tools risks deleting unrelated Codex data/projects unless the user manually inspects the paths.
No machine-specific temp token, username, workspace path, or session identifier is included here.
liuminsheng3 commentedon Jun 19, 2026
The 125-130GB confirmations make this worth splitting into two tracks: safe user cleanup and product-side retention.
From the reports here, the large tree appears to be temporary macOS app clones under
/private/var/folders/.../X/com.openai.codex.code_sign_clone, not~/.codex, project workspaces, or normal Codex app support state. I would avoid broad app-cleaner deletion until the clone root is measured separately.A low-risk evidence block for affected users:
For cleanup, the narrow boundary I would use is: quit Codex, confirm
lsof +D "$root"is empty, then move onlycode_sign_clone.*directories to Trash. Do not delete~/.codex, workspaces, session files, credentials, or the whole app support folder as part of this workaround.For the product fix, useful acceptance checks might be:
code_sign_clone.*dirs return to zero or a bounded count;I maintain a Mac storage cleanup tool, so I wrote the Codex-specific checklist here for anyone who wants the same commands without digging through the thread: https://www.getsafedisks.com/codex-code-sign-clone-disk-space-mac?utm_source=github&utm_medium=issue-comment&utm_campaign=codex-code-sign-clone-retention&utm_term=codex-macos-temp-clones&utm_content=openai-codex-25667
Jolg42 commentedon Jun 20, 2026
Same issue here on macOS 26.5.1 ... 13GB wasted in just a few days just for this issue.
Vibe coding is terrible 😆 this is yet another way for Codex to waste disk space... See #25921
Jolg42 commentedon Jun 20, 2026
I added a local macOS cron workaround for this.
The workaround runs hourly and cleans up leaked Codex code-sign clone directories under:
/private/var/folders/*/*/X/com.openai.codex.code_sign_clone/code_sign_clone.*It keeps the newest birth-time group in each Codex temp parent and deletes only strictly older
code_sign_clone.*directories. If multiple clone dirs have the same newest birth time, I keep all of them instead of guessing which one is safest to remove.Cron entry:
Script:
I tested it against the real leaked directories on my machine. With three clone dirs present, it kept the newest one and removed the older two. A later dry run with one remaining clone dir reported that it would keep it.
cyfung1031 commentedon Jun 21, 2026
Thanks for this issue opening. I finally know where my disk space gone.
SameDesu123 commentedon Jun 21, 2026
Same issue here:

It took up over 23GB
liuminsheng3 commentedon Jun 22, 2026
Small safety note on the cron/read-only workarounds above:
The clone path here does look like temporary app clone state, but I would keep any workaround reversible. I would not make the clone parent, Crashpad pending folder,
~/.codex, or the app support folders permanently read-only. That can hide the symptom while breaking future launches, updates, crash reporting, or diagnostics.Guardrails I would add before running this unattended:
lsof +D "$root"returns anything;rm -rfdirectly;For this specific issue, SafeDisk Lite is not the authoritative scanner because
/private/var/foldersmay sit outside the normal user-folder scan. The Codex-specific read-only checks are the important part. I updated the checklist with these guardrails here: https://www.getsafedisks.com/codex-code-sign-clone-disk-space-mac?utm_source=github&utm_medium=followup&utm_campaign=first-paid-cleanup&utm_term=codex-code-sign-clone-macos-temp-clones&utm_content=cron-readonly-safety-followupReyNeill commentedon Jun 23, 2026
Please someone fix this, had to make a LaunchAgent that looks for old clones in order to clean them
PS: This wouldn't happen if the app is open source :D
rszrszrsz commentedon Jun 24, 2026
I can reproduce this on another Mac, and the impact is larger after several days of normal use.
Environment:
Current Codex clone usage:
du -sh /private/var/folders/mh/v230pzl128v87fb3bc826kb80000gn/X/com.openai.codex.code_sign_clone # 21G /private/var/folders/mh/v230pzl128v87fb3bc826kb80000gn/X/com.openai.codex.code_sign_cloneCodex clone count:
The Codex clone directories have mtimes across June 16-24, 2026, with several created on June 22-24. This matches the report: repeated app launches leave inactive
code_sign_clone.*directories behind instead of cleaning them up, and it can consume tens of GB without the user installing anything.hourianto commentedon Jun 24, 2026
Can confirm this issue as well, I've had to clean up space on my Mac multiple times, and the Codex app is always one of the biggest offenders, taking up gigabytes due to this.
emreertunc commentedon Jun 24, 2026
Can confirm. I started to cleanup my 512GB macbook constantly because of this. I delete these directories and they come back as 30-50-sometimes even 70 GB.
init-center commentedon Jun 25, 2026
This file takes up over 70 GB of disk space.