Guides · Codex CLI
How to back up and move Codex CLI sessions to another machine
Codex CLI records each thread as a rollout file under your home directory. Those files only exist on the machine where the thread ran, so switching computers means starting the thread over.
vibi backs up the rollout files encrypted, restores them in the place Codex CLI reads from, and sends them to teammates who can resume the thread themselves.
Where Codex CLI keeps sessions
- ~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<thread-id>.jsonl
- the thread, one JSON record per line, filed under the day it started
- ~/.codex/session_index.jsonl
- an index with thread names and last-updated times
- The thread id is the UUID at the end of the file name; codex resume <thread-id> takes it.
- vibi uses the thread name from the index as the session title when there is one.
How sessions get lost
- A new or reinstalled machine: nothing syncs ~/.codex by default.
- Cleaning out old session files by date.
- A teammate who needs to pick up the thread has no way to get the file but copying it by hand.
Back up Codex CLI sessions
vibi is a single executable for macOS, Linux and Windows; nothing else to install, no root.
curl -fsSL https://vibivibi.com/install.sh | sh
- Install vibi and enroll the machine once.
- In the project directory, run the picker; it lists the Codex threads whose working directory is that project.
vibi push
- Choose Sync. The rollout file is encrypted locally and uploaded; later pushes add versions.
- Non-interactive form for scripts.
vibi push --session 1 --sync
Restore on another machine
- Enroll the other machine and pick the thread.
vibi pull
- vibi writes the file back under ~/.codex/sessions/ with its original name, filed under the right day, so Codex CLI lists it again.
codex resume <thread-id>
- Older versions by number.
vibi pull <id> --rev 1
Share a session with a teammate
- In the picker choose Send and type their email. The session is encrypted for their key on your machine; they see it in their inbox and pull it with their own password.
- If the address has no vibivibi account yet, vibi makes a provisional key for them, shows you a one-time passphrase before anything is uploaded, and emails them an invitation. They sign up, enroll a machine, and type the passphrase once.
- Sending again after more work adds a version; recipients keep the one they were sent.
What is encrypted
The session content, its title, working directory and model name are encrypted on your machine with a key only you and your recipients hold (X25519, HKDF-SHA256, AES-256-GCM; the private key is wrapped with your encryption password). vibivibi stores the ciphertext, its size, a fingerprint of the key, the agent kind and the optional plain-text name you give a session. The client is open source, so this can be checked: github.com/subconscious-systems/vibi-cli.
Questions
- Where are Codex CLI sessions stored?
- In ~/.codex/sessions/, in folders by year, month and day, as rollout-<timestamp>-<thread-id>.jsonl files. ~/.codex/session_index.jsonl holds thread names.
- How do I resume a Codex thread on another computer?
- Back it up with vibi push, pull it on the other machine with vibi pull, then run codex resume <thread-id>. The file is restored with its original name under the day folder.
- Can a teammate continue my Codex thread?
- Yes. Send it with vibi push; it is encrypted for their key, they pull it and run codex resume. They need a vibivibi account; if they do not have one yet, vibi invites them and gives you a passphrase to pass on.
Other agents: Claude Code · OpenCode · Pi. Start with the free plan: 200 MB of encrypted sessions, two machines, unlimited sends.