Returning to unfinished work
How to resume a Codex session without losing your place
Use the Codex CLI session picker, --last and a session ID, then check the project files and execution state before continuing interrupted work.
Based on public documentation and selected source code. These workflows have not been tested here on multiple devices. Availability and compatibility can change.
Choose the session explicitly
The local CLI help checked for this guide exposes a saved-session picker, a latest-session shortcut and selection by session ID. The official developer command reference is the source to check when your installed version differs.
# Choose a saved interactive session
codex resume
# Continue the most recent session
codex resume --last
# Show sessions beyond the current directory filter
codex resume --all
# Target one known session (replace SESSION_ID)
codex resume SESSION_IDThese commands select conversation history. Before continuing, read the last exchange and verify the project directory. With multiple repositories or concurrent jobs, a known session ID is easier to audit than “the latest one.” The commands were checked against CLI help, not tested as a cross-device migration.
If the session does not appear
- Check the host. Was the task running on this computer, a remote computer or in Codex Cloud? Open the surface connected to that execution environment.
- Check the directory filter. The local help describes
--allas disabling current-directory filtering. It broadens the picker; it does not promise a cross-machine import. - Check the session and configuration. A different installation or Codex home can expose different saved history. Inspect your setup before moving files.
- Check whether it was saved. The CLI exposes an ephemeral mode for non-interactive runs. A run intentionally created without persistent session files should not be treated as a recoverable saved session.
Do not copy the entire Codex configuration directory into a public repository to solve this. OpenAI’s automation documentation warns that authentication state contains access tokens. Conversation transfer and credential sharing are different operations.
Reconcile the conversation with the project
A saved reply might say “I am running the tests,” but the process may no longer exist. A previous edit may remain on disk even if the assistant never reported success. Inspect the actual files and status before asking it to repeat the last action.
# Read-only checks inside the intended Git repository
git status --short
git diff --statAlso check untracked files, the selected branch and any test or build log. A migration, payment, deployment or external message can have side effects even if the conversation ended before acknowledgement. Verify the external result before retrying such an action.
We are resuming this task. First inspect the current branch, changed files and the last test result. Tell me which parts are complete, which are uncertain, and what remains before making further edits.
Resume a scripted run deliberately
The documented non-interactive form is codex exec resume. Use an explicit session when jobs overlap, keep the expected checkout available, and review the run’s output before triggering a follow-up.
# Replace SESSION_ID with the intended saved run
codex exec resume SESSION_ID "Inspect the current diff and summarize the next step."If your real problem is switching computers, follow the cross-device session guide. If the original work ran in the cloud, reopen that same task rather than starting a new one with a similar title. For keeping future work available while away, see running Codex overnight.
More Codex guides
Common questions
Why is my previous Codex session missing from the picker?
First check the execution host, working directory and Codex configuration. The resume picker can filter by the current directory; --all expands that view. It is not an instruction to download every session from another device.
Does codex resume --last choose the right project automatically?
It selects a recent saved session according to the CLI’s selection rules. Check the conversation and working directory before sending another instruction, especially when several projects are active.
Can I resume a non-interactive run?
The Codex CLI documents codex exec resume with a session ID or --last. Confirm your installed version’s help and use a specific session ID when several automated runs may overlap.