Repository navigation
Codex Desktop background exec intermittently deletes ~/.codex/skills/.system #19265
Description
What happened?
On Codex Desktop, the Codex-managed system skills directory under ~/.codex/skills/.system repeatedly disappears and later reappears. When it is absent, new turns do not get the bundled system skills in the available-skills list.
The missing skills are:
imagegenopenai-docsplugin-creatorskill-creatorskill-installer
Observed timeline
Local timezone: EDT, April 23, 2026.
22:53:09:~/.codex/skills/.systemwas present with all five expectedSKILL.mdfiles and.codex-system-skills.marker.22:56:24:codex_chroniclelaunched a childcodex execprocess with--ephemeral,--ignore-user-config,--ignore-rules, and--config skills.bundled.enabled=false.22:56:25:~/.codex/skillsmtime/ctime changed.23:01:51:~/.codex/skills/.systemwas missing. A search only foundplugin-creatorin a temp plugin area andopenai-docsundervendor_imports; none of the expected system skills existed under~/.codex/skills/.system.23:02:57:~/.codex/skillschanged again, and the.systemdirectory was later present again.
This also happened earlier in the same session: a check saw the full .system directory with all system skills, and a follow-up check about 15 seconds later found the directory gone.
Why this looks like a Codex bug
The Codex binary appears to contain a built-in system-skills sync path. Running strings against the desktop app's codex binary shows strings including:
remove existing system skills dircreate system skills dirwrite system skill file.codex-system-skills.marker
That suggests Codex owns this directory and likely removes/recreates it during system-skill sync. The observed failure mode looks like a delete-before-rewrite race or a background/ephemeral process running the cleanup path while skills.bundled.enabled=false, so it removes the global system skills but does not rewrite them.
Expected behavior
- Background or ephemeral
codex execjobs, especially ones launched withskills.bundled.enabled=false, should not mutate the global~/.codex/skills/.systemdirectory. - System skill refresh should be atomic, e.g. write to a temporary directory and rename into place, so there is never a window where the directory is missing.
- Disabling bundled skills for one process should not delete the user's shared system skills installation.
Actual behavior
~/.codex/skills/.system flickers between present and absent. When absent, system skills are not available in new turns/sessions.
Environment
- Codex Desktop:
26.422.21459/ build2049 codex-cli:0.124.0-alpha.2- macOS:
26.0.1(25A362) - Chronicle/memories enabled in the desktop app
Suggested fix
The safest fix is likely:
- Do not run global system-skill installation/removal from ephemeral/background
codex execprocesses. - Never remove
~/.codex/skills/.systemwhenskills.bundled.enabled=false. - Make the system-skill sync atomic: write
~/.codex/skills/.system.tmp-*, validate contents and marker, then rename into place.
Activity
gustavosmendes commentedon Apr 28, 2026
Additional confirmation from Codex Desktop on macOS.
Environment:
Observed today: the same five documented system skills were not available in the local Codex session:
A local docs check showed that the official Codex docs describe
$skill-creatorand$plugin-creatoras built-in/system skills. Local Git evidence also showed that the vendoredopenai/skillscheckout contains all five underskills/.systemin the Git tree:But the materialized sparse checkout only included:
So
skills/.systemexisted in the Git object tree but was absent from the filesystem. The active local skill directory also lacked these five system skills, and the local bundled/runtime marketplace JSON files did not list them as plugins.Manual remediation worked: copying the five
skills/.system/*directories from the vendored Git tree into a scanned local skill path made them structurally valid. Validation passed with:One related nuance: absence from a generated visible skill inventory is not sufficient proof that a skill cannot load, because explicit linked-skill invocation can still work. In this case, however, the stronger evidence is filesystem-level: the five system skill folders were not materialized under scanned skill paths until copied manually.
This seems consistent with this issue's root concern: Codex-managed system skills can be missing from local sessions even though the current docs and the vendored
openai/skillstree expect them to exist.baykalc commentedon May 1, 2026
Additional confirmation from another macOS Codex Desktop install, with a smaller isolated repro.
Environment:
26.429.20946/ build2312codex-cli 0.128.0-alpha.1codex-cli 0.128.0/@openai/codex@0.128.026.4.1(25E253)User-visible symptom:
$imagegen,$skill-creator, and$skill-installerappear briefly in the Codex app skill/capability surface, then disappear after the app finishes initializing.~/.codex/skills/.systemflips between present and missing.imagegen,openai-docs,plugin-creator,skill-creator,skill-installer.Local process correlation:
codex_chronicle/memory background work launching childcodex execprocesses with--config skills.bundled.enabled=false..system/.../SKILL.mdpaths in the prompt metadata, but the on-disk~/.codex/skills/.systemdirectory was then missing immediately afterward.skills.bundled.enabled=falsechild processes were running and~/.codex/skills/.systemstayed present in the immediate recheck.Isolated repro, no user config needed:
Code-level read from current
mainappears to explain the behavior:codex-rs/skills/src/lib.rsmaterializes embedded system skills underCODEX_HOME/skills/.system.codex-rs/core-skills/src/manager.rscallsuninstall_system_skills(&manager.codex_home)whenbundled_skills_enabledis false.SkillScope::Systemroots when bundled skills are disabled, so deleting the shared cache looks unnecessary for enforcing the config.codex-rs/core-skills/src/manager_tests.rscurrently asserts that disabled bundled skills remove the cached.systemdirectory, which bakes in the cross-process side effect.My read:
skills.bundled.enabled=falseshould be process-local visibility/config, not a global mutation of sharedCODEX_HOME. If stale cleanup is still needed, it should not run from ephemeral/background child jobs and should not delete the cache used by the main app/session.y2ambition-ai commentedon Jul 17, 2026
Additional confirmation on the current desktop build, with the cross-thread impact made explicit.
Environment
26.707.919480.144.5Still reproducible on 0.144.5
Using an isolated temporary
CODEX_HOME:The affected user's global
config.tomldoes not setskills.bundled.enabled=false. The live Chronicle background process was observed launching an ephemeral child with both:Therefore setting
skills.bundled.enabled=truein the user's global config cannot prevent this: the child ignores user config and the explicit CLI override wins.Why this is a cross-thread correctness bug
All desktop threads share the same
$CODEX_HOME/skills/.systemdirectory. A background Chronicle/summary child created for one thread can therefore delete the system-skill installation used by every other concurrent thread.Consequences are broader than the skill picker briefly flickering:
imagegen,openai-docs,plugin-creator,skill-creator, orskill-installer.The root cause appears to be that process-local visibility configuration is implemented as a global filesystem mutation:
bundled_skills_enabled=falsecalls the system-skill uninstall path against the sharedCODEX_HOME.Expected behavior: disabling bundled skills should only filter
SkillScope::Systemfor that process. It should never delete the shared system-skill cache, especially from an ephemeral/background child. If refresh/removal is needed, it should be owned by one authoritative process and performed atomically.JavierPiedra commentedon Jul 24, 2026
Confirming this is still happening in Codex Desktop on macOS (2026-07-23).
~/.codex/skills/.systemexists but contains only.codex-system-skills.marker(4 KB), with no bundledSKILL.mdfiles. As a result,skill-creatoris absent from the available-skills list.I did not modify that directory.
alfozan commentedon Aug 9, 2026
Additional confirmation on a newer Codex Desktop build.
Environment:
26.803.41515(build6321)codex-cli 0.147.0-alpha.6.5codex-cli 0.147.026.6.1(25G76), arm64Observed:
~/.codex/skills/.systemwas missing while~/.codex/skills/chronicleremained.config.toml, Desktop version, and CLI version still had the current six-skill bundle:imagegen,openai-docs,plugin-creator,review-agent,skill-creator, andskill-installer..systemdisappeared again.codex_chroniclebinary contains an embedded internal configuration withskills.bundled.enabled=false. The persistent user config did not contain that global setting.review-agent, and its files on the healthy Mac matched the currentopenai/codexsource byte-for-byte.Workaround verification:
[features] chronicle = false.codex_chronicleprocess, since changing the config did not stop the already-running process immediately..systemfrom the healthy same-version Mac..codex-system-skills.markerfile was present, Chronicle stayed stopped, and all six skills remained present in the immediate delayed recheck.This confirms the destructive shared-cache behavior still reproduces on Desktop
26.803.41515/ bundled CLI0.147.0-alpha.6.5. It also matches the exact duplicate in #21933 and the UI-level symptom in #20629.techronin commentedon Aug 10, 2026
Independent confirmation from another current Codex Desktop installation, plus a tested bounded recovery.
Environment
26.803.41515/ build6321codex-cli 0.147.0-alpha.6.5Isolated reproduction
Using the exact binary bundled in
/Applications/ChatGPT.appand an isolated temporaryCODEX_HOME:debug prompt-inputmaterialized the current six-package system bundle:imagegen,openai-docs,plugin-creator,review-agent,skill-creator, andskill-installer.--config skills.bundled.enabled=falseremoved the entireskills/.systemdirectory.The affected normal
CODEX_HOMEhad the same user-visible symptom: the whole.systemcache disappeared while personal skills remained. I cannot retrospectively identify the exact historical deleting PID, but the destructive binary behavior itself is deterministic in isolation.Impact
This removed both
skill-creatorandskill-installerduring active Skills work. The session still advertised their paths, so agents could either fail when reading the files or silently substitute package-specific checks. The failure recurred after earlier local repairs because those repairs addressed package contents, not global cache deletion.Bounded local mitigation
I implemented and tested a fail-closed recovery in techronin/skills PR #258:
.systemdirectory is absent;skill-creatorandskill-installerfiles;skill-creatorby initializing and validating a fresh temporary skill.This is only a local mitigation. The durable fix should make
skills.bundled.enabled=falseprocess-local and remove the global uninstall side effect, particularly for ephemeral/background jobs.TyceHerrman commentedon Aug 16, 2026
looks like fixed with #36989. Processes with
skills.bundled.enabled=falsenow hide system skills without deleting the shared$CODEX_HOME/skills/.systemcache.Two independent bugs remain:
the
skills.bundled.enabled=falsedeletion reported here appears done though and this can be closed afaikomarpinarecords commentedon Aug 17, 2026
Same as this? #37783 (comment)
TyceHerrman commentedon Aug 18, 2026
yea i think it's basically a duplicate and should be closed as such. this issue should also be closed, but because 36989 fixed it
omarpinarecords commentedon Aug 22, 2026
chronicles removed and replaced by computer history i think
Racerx323 commentedon Sep 29, 2026
Additional, related reproduction on Ubuntu/WSL with two clients sharing a Codex home. This differs from the original disabled-bundled-skills reproduction, so I cannot yet establish a common root cause.
With CLI 0.159.0, and again after updating to 0.159.1, app-server initialization followed by forced
skills/listremoves all eleven files of a host-materializedplugin-creatorsystem skill and replaces.codex-system-skills.marker. Other system-skill file hashes remain unchanged. A later host invocation materializes the omitted skill again. The precise host bundle release is not established.The same SKILL.md is accepted when placed in an isolated throwaway repository skill directory. This narrows the problem to bundle refresh/discovery rather than demonstrating invalid frontmatter. The temporary copy was only a diagnostic fixture; no permanent personal duplicate was installed.
Reproduction (back up the managed system directory first):
codex app-server --stdioagainst the same Codex home.initialize(clientInfo and experimentalApi capability), theninitialized.skills/listwith the workspace incwdsandforceReload: true.Sanitized observations and reproduction notes:
Could maintainers clarify intended bundle ownership when clients share a Codex home? Client/bundle-specific caches or explicit ownership, combined with locked atomic refresh, appear worth investigating. Atomic replacement alone would remove the missing-directory window but would not prevent two distinct bundles from replacing one another. These are proposed directions, not a tested upstream fix.