A saved Codex thread can hold plans, tool output, file context, and decisions that would be tedious to rebuild after closing the terminal. Resuming the last session reopens the newest recorded interactive thread for the current working directory, so the next request can refer to that earlier conversation.
Session history belongs to the local Codex home, and the newest thread is selected within the current working directory. A different home or project folder can therefore select different history. Restoring a conversation does not roll project files back to their earlier contents.
An installed Codex CLI, a real terminal, an existing interactive thread, and working access to its model provider are required. Old messages may reopen while the model provider is unavailable, but a new request needs a working connection to complete.
Steps to resume the last Codex session:
- Return to the project directory used for the saved session.
$ cd /work/example-app
The path is an example; the project directory and Codex home must be the ones used for your saved session.
Related: How to set the working directory for Codex - Resume the newest saved interactive thread for that project.
$ codex resume --last
The --last option skips the picker and retains the current-directory filter. No additional sandbox or approval override is needed to resume the conversation.
- Check that the restored conversation contains a recognizable earlier request and reply.
The project directory should match, and the input prompt should be ready. If no saved session is found, the folder or Codex home may differ, or there may be no interactive history there. If no history exists in that home, codex starts a new session. If the conversation is unfamiliar, exit with /quit before submitting work; codex resume opens the picker for choosing the intended saved thread.
- Submit a follow-up about a detail in the restored conversation.
For a naming discussion, “What was the first name you suggested?” refers to the earlier reply. Your question should fit your own saved conversation. The Enter key submits the request.
- Confirm that the new reply answers the follow-up using the earlier conversation.
The answer should agree with the restored history, and the input prompt should remain available for further work. An unrelated answer or a model-provider connection error does not confirm a usable continuation.