Give Codex a bigger suitcase: a friendly, fail-closed macOS CLI that moves its local state to an external APFS SSD — no symlinks, no surprises, no drive, no launch.
Tested a different Mac or SSD?
Share your setup
·
Compatibility lab
·
Community cabin
Codex can accumulate sessions, logs, skills, generated files, SQLite state, and other local data under CODEX_HOME. Codex Carry-On moves that state to an external SSD, verifies the copy, keeps a protected pre-migration recovery baseline on the Mac, and refuses to launch against the wrong or missing drive.
It builds on Codex’s documented public location variables: CODEX_HOME and CODEX_SQLITE_HOME.
This project is terminal-first, dependency-free, and intentionally scoped to Codex/ChatGPT desktop state only. It refuses to take over an existing custom CODEX_HOME policy; return to the standard ~/.codex layout before setup.
Our first public milestone is five independent installations across more than one Mac model and more than one SSD family. A successful report is useful data, not clutter.
- Share a working setup in Show and tell.
- Ask before migrating in Q&A.
- Use the Mac + SSD compatibility form when a result should be tracked.
Please include the Mac, macOS version, SSD or enclosure, connection, APFS status, Carry-On version, and a concise redacted result. See the compatibility lab for the reporting format.
Codex Carry-On moves important local state. Treat it like a storage migration, not a theme switch.
- Use a dedicated encrypted APFS SSD with ownership enabled.
- Keep another independent backup of anything irreplaceable.
- Quit ChatGPT/Codex before setup, rollback, repair, or intentional drive removal.
- Never hard-pull the SSD while the app is running.
- This is an independent community project, not an OpenAI product.
The internal recovery baseline is a pre-migration rollback point. It is not a live backup of newer SSD-only sessions.
- macOS with Python 3.9 or newer
- a dedicated external USB or Thunderbolt SSD formatted as APFS
- encrypted APFS and ownership enabled (recommended and enforced by default)
- enough free space for the state copy plus a 10 GiB safety reserve
- ChatGPT/Codex fully quit during setup, repair, rollback, or rescue
curl -fsSL https://raw.githubusercontent.com/jazzinglee/codex-carry-on/main/install.sh | zshOpen a fresh Terminal, then plug in the SSD and run:
codex-carry-on doctor --volume /Volumes/MySSD
codex-carry-on setup --volume /Volumes/MySSDSetup explains the exact source, destination, recovery path, and drive identity, then requires this confirmation:
PACK CODEX INTO THE CARRY-ON
Administrator authentication may be requested only for the metadata-preserving copy.
- Verifies macOS, APFS, external-media identity, encryption, ownership, write access, and free space.
- Proves ChatGPT/Codex is offline for a stability window.
- Copies state with macOS metadata, ACLs, flags, resource forks, and extended attributes.
- Omits only the transient zero-byte
ipc/ipc.sockendpoint when present. - Compares paths, bytes, symlinks, ownership, modes, flags, mtimes, ACLs, portable xattrs, and hardlink topology.
- Accepts APFS-generated differences only for
com.apple.provenance;com.apple.maclmust remain exact. - Validates every discovered SQLite family from disposable copies using
quick_check,integrity_check, andforeign_key_check. - Promotes verified staging with an exclusive same-volume rename.
- Moves the original
~/.codexinto a protected recovery baseline under~/Library/Application Support/CodexCarryOn/. - Records a stable cryptographic recovery fingerprint while deliberately ignoring allocation and APFS provenance-only drift.
- Places a zero-byte mode-
000guard at~/.codexto prevent silent fallback recreation. - Pins the installed guard, verifier, and LaunchAgent hashes in the manifest.
- Installs a LaunchAgent that sets
CODEX_HOMEandCODEX_SQLITE_HOMEonly when the recorded SSD identity passes. - Optionally wraps the interactive
codexcommand in~/.zshrcso each CLI launch revalidates the drive.
No .zshenv modifications. No symlinked state root. No other agent integrations.
Normal Dock/Finder launches work once the recorded SSD is mounted and ready.
codex-carry-on status
codex-carry-on open
codex-carry-on run -- --versionThe optional shell hook makes ordinary CLI calls safe too:
codex --versionThe periodic guard validates while the healthy environment remains on the SSD. It switches to an unwritable sentinel only when validation fails, avoiding a recurring healthy-launch race.
| Command | Purpose |
|---|---|
doctor --volume /Volumes/MySSD |
Check prerequisites without moving data |
setup --volume /Volumes/MySSD |
Copy, verify, and cut over |
status [--json] |
Show readiness and recorded paths |
open [--app ChatGPT] |
Revalidate and open the desktop app |
run -- <args> |
Revalidate and run the official Codex CLI |
repair |
Recreate the fallback guard after an app updater replaced ~/.codex |
rollback |
Restore the protected pre-migration internal state |
rescue --status |
Inspect a partial transaction |
rescue --restore-internal |
Restore the sole retained baseline when normal rollback cannot run |
shell-hook --install/--remove |
Manage the optional interactive zsh wrapper |
- Quit ChatGPT/Codex completely.
- Confirm no Codex process remains.
- Eject the SSD normally.
When the drive is absent, new GUI and CLI launches fail closed. Reconnect the recorded SSD, wait a few seconds, then run:
codex-carry-on statusAn updater may replace or remove the fallback object at ~/.codex. The protected baseline lives elsewhere, so this does not destroy the recovery copy. Keep the app closed and run:
codex-carry-on repairThe command preserves any unexpected ~/.codex object before creating a new guard and updating its recorded identity.
codex-carry-on rollbackRollback first re-hashes the protected recovery baseline and requires its stable fingerprint to match the setup record. It then restores only the retained pre-migration internal state. The external SSD state remains untouched; newer SSD-only sessions are not merged automatically.
Codex Carry-On relocates the state rooted at CODEX_HOME and points CODEX_SQLITE_HOME to the same external home. It does not move the application bundle, Homebrew, Xcode, Simulator state, or unrelated caches under ~/Library.
See Architecture, Recovery, Compatibility, Community, and Security for the detailed model.
git clone https://github.com/jazzinglee/codex-carry-on.git
cd codex-carry-on
python3 -m unittest discover -s tests -v
./bin/codex-carry-on --versionThe test suite runs pure logic and a mocked end-to-end cutover on Linux and macOS. Real migration tests require a disposable external APFS volume and are intentionally not run in shared CI.
MIT. Pack lightly, verify heavily.
