Repository navigation
Codex Retain 0.2.0
Universal local Codex client and version compatibility release. Removes the
hardcoded codex-cli 0.153.4 version pin, exact SQLite schema checksum check,
and private triggers inside Codex's database so Codex Retain works across Codex
CLI, macOS Codex Desktop (/Applications/Codex.app), IDE extensions, and
past, current, and future Codex versions sharing $CODEX_HOME.
What changed
- Capability-based storage contract (no version pin): Automatically selects
the highest numericstate_<N>.sqlitein$CODEX_HOME, validates the core
threadscontract (idPK,rollout_path,archived,archived_at), and
dynamically adapts to optional columns and tables (name,title,
history_mode,is_pinned,thread_section_id,thread_sections,
thread_spawn_edges,backfill_state,_sqlx_migrations). - Forward-compatible safeguards: Dynamically discovers
"Pinned"sections
inthread_sections, protects unknown protective columns onthreads(such
aspinned_atoris_starred), skips unknown per-threadhistory_mode
values without blocking eligible peers, detects child tables with
ON DELETE RESTRICTorNO ACTIONforeign keys tothreadsbefore staging
any files, and fails closed on missing core columns, failed_sqlx_migrations,
incompletebackfill_state, or self-referentialON DELETE CASCADE. - External sidecar epoch tracker (
state_dir/tracker.sqlite): Moves
tracked archive epochs out of Codex's database into a private (0o600,
DELETEjournal mode,synchronous=FULL) SQLite sidecar inside the utility
state directory. Injects zerocodex_retain_*tables or triggers into Codex's
database, survivesstate_5.sqlite -> state_6.sqliteupgrades cleanly, and
quietly syncs archive/restore transitions during paused scheduled runs (opening
Codex strictly read-only). - Codex Desktop and CLI-less operation: Makes
--codex-binoptional
(diagnostics only) so Desktop-only and IDE-only setups work withoutcodexon
PATHand scheduled runs never spawncodex --versionor require Node.js.
doctorandstatusauto-discover local CLI and macOS Codex Desktop
installations and report their versions. - Codex Desktop pin protection: Reads
$CODEX_HOME/.codex-global-state.json
when present (O_NOFOLLOW, regular-file validation, 16 MiB cap, stamp-cached
with live re-verification underBEGIN IMMEDIATE), protecting Desktop-pinned
threads across known JSON shapes and failing closed on unreadable, corrupt, or
symlinked global state. - Seamless
0.1.xupgrade: Existing0.1.xpolicies with legacy
codex_retain_*tables/triggers instate_5.sqliteremain readable during
read-onlystatus/previewand automatically migrate their tracked epochs
intotracker.sqlitewhile removing legacy triggers on the firstrun(or
disable/uninstall).
Update
brew update
brew upgrade dankosik/codex-retain/codex-retain
codex-retain --version
codex-retain statusInstaller users can rerun the installer at the same installation directory.
Installation does not enable retention. Existing policies, exclusions, and
captured archive periods are preserved; upgrading from 0.1.x no longer
requires disabling Retain before Codex upgrades.
Compatibility and verification
- macOS 15+ release archives for Apple Silicon (
aarch64-apple-darwin) and
Intel (x86_64-apple-darwin), covering Codex CLI, Codex Desktop, and IDE
clients sharing$CODEX_HOME. - Linux remains experimental for read-only core,
doctor, andpreviewpaths;
destructive commands and scheduling remain macOS-only. - All automated validation uses synthetic profiles (
240Rust unit and
integration tests includingtests/universal.rs, plus release and skill
maintenance suites).