Returning to unfinished work
Codex CLI resume: --last, session IDs and missing chats
Resume a Codex CLI session with --last or a session ID. Download a recovery checklist to verify the host, project files and last result before repeating 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 in the current directory
codex resume --last
# Select the most recent session across directories
codex resume --last --all
# 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.
Download the recovery checklist
Download the free Markdown checklist and fill it in on your computer. It is a reusable note template, not a session importer. Nothing in the file runs automatically or sends your answers to us. Keep credentials, full transcripts and private code out of anything you share.
Record six facts: the execution host, intended session, project path and revision, unfinished changes, last verified result, and one next step. Leave an unknown result marked unknown. If the host or files do not match, resolve that mismatch before asking the agent to continue.
# Inspect only; these commands do not resume or modify a session
codex --version
codex resume --help
# Inside the intended Git checkout
git rev-parse --show-toplevel
git branch --show-current
git rev-parse --short HEAD
git status --short
git diff --statThe version and resume-help commands were checked locally with Codex CLI 0.160.0 on October 10, 2026. That confirms available flags on that installation, not a successful multi-device transfer. The official resume reference also describes how the working directory is chosen when it differs from the saved session.
Before repeating the last action
Use evidence from the system that received the action. Conversation history alone cannot settle whether a deployment, database migration or submission completed.
- Result verified: record the receipt or revision and continue from it. Do not repeat the operation just because the final chat reply is missing.
- Failure verified: record the failure and retry only the remaining step, using the service’s normal retry or recovery mechanism.
- Result unknown: inspect the provider, logs or application state first. If you still cannot establish the result, stop that operation and ask for the missing evidence.
The last chat says “deploying” and then ends. The provider shows the intended commit ready and the production URL serving it. The next step is to verify the page and report the existing release, rather than create another deployment. If the provider still shows a running deployment, wait for its result before retrying.
The downloadable checklist includes a continuation prompt that asks the agent to inspect these facts before changing anything. For a different execution host, use the handoff checks as well.
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?
The current official reference scopes --last to the current working directory unless you also pass --all. Check the selected conversation and directory before continuing; neither option imports a session from another machine.
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.
How do I avoid repeating a deployment when I resume Codex?
Check the deployment provider for a receipt, commit and current production target before asking Codex to deploy again. A missing chat acknowledgement does not prove that the external action failed. The recovery checklist separates a verified result, a failed result and an unknown result.
Can I download a Codex session recovery checklist?
Yes. This guide includes a free Markdown checklist for recording the execution host, session, repository state, last verified result and next step. Fill it in locally; it does not import a session, run commands or send your information to CodexAnywhere.