The steps depend on which surface you were using. In Claude Code’s command-line interface, run claude --continue from the project directory to reload the most recent conversation, or claude --resume <session-id> to open a specific one. In a Codex app-server integration, you resume a saved thread ID with a thread/resume request after the server restarts. In an OpenAI Agents API application, you retrieve a stored session ID, check its status and any required actions, and then continue. The three paths use different identifiers and different commands, so identify your surface before you run anything.
Identify which surface you used
Most restart problems come from following a procedure written for a different tool. Match your situation to one row before you begin.
As an Amazon Associate I earn from qualifying purchases.
| Surface you used | Identifier you need | Recovery entry point |
|---|---|---|
| Claude Code CLI in a terminal | Most recent conversation in the current directory, or a session ID | claude --continue (-c) or claude --resume <session-id> (-r) |
| Codex app-server (a program you build that talks to the app-server protocol) | Thread ID returned when the thread was started | Initialize the restarted app-server, then send thread/resume with the saved ID |
| OpenAI Agents API application | Session ID stored with your application’s conversation record | Retrieve the session, check status and required actions, then continue |
This guide does not cover the resume commands of the Codex terminal interface or IDE extensions. The official material available for this topic documents the app-server protocol and the Agents API, not those interfaces, so do not assume the app-server steps apply to them.
Recommended Free Tools
Claude Code CLI
The Claude Code CLI reference documents two ways to load a previous conversation. Both are run from the terminal, and the first depends on your current directory.
#1 Best Overall
Continue the latest conversation in the current directory
Change into the project directory where the conversation took place, then run:
cd /path/to/your/project
claude --continue
The short form is claude -c. Because this option selects the most recent conversation for the current directory, starting it from a different folder can load a different history or none at all. If you worked on several tasks in the same folder, this option returns only the newest one; use the session-ID route for anything older.
Resume a specific session by ID
When you have the session ID for the conversation you want, pass it directly:
claude --resume <session-id>
The short form is claude -r <session-id>. Replace <session-id> with the literal identifier, not the placeholder text. The reference describes this as resuming a session. It does not promise that unsaved in-memory state, such as a command that was still running when the terminal closed, will be restored, so check the files and the last messages before continuing work that depended on it.
Rank #3
Codex app-server
The app-server path is a protocol flow for developers embedding Codex in their own software. Its restart behavior depends on your application saving one value: the thread ID returned when the thread was created.
Save the thread ID when you start the thread
The thread/start call returns a thread ID. Store it in your application’s database or settings before the process can exit. If you lose it, the protocol gives you no other documented way to name that thread in a resume request, so treat this step as the one that determines whether recovery is possible.
Rank #4
Resume after the app-server restarts
- Start the app-server process again.
- Initialize the new process using the same handshake your integration normally performs at startup.
- Send a
thread/resumerequest containing the saved thread ID.
The official Codex app-server example, linked below, shows this sequence in the context of a sign-in and token-sharing setup. Treat it as a worked protocol example rather than the required procedure for every integration. Your exact request fields should match the protocol documentation for your version.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11OpenAI Agents API sessions
Agents API sessions are managed by your application rather than by a terminal. The OpenAI guides describe a retrieve-check-continue workflow that works after a process restart or a dropped stream.
Best Value
Store the session ID with your conversation record
Save the session ID alongside the user, conversation, or ticket it belongs to. Without it, your application has no way to retrieve the session after restart. Storing it in process memory alone does not survive a restart.
Retrieve the session and inspect its state
- After the restart or disconnect, retrieve the session using the stored ID.
- Read the session’s
statusand itsrequired_actionsfield. - If
required_actionslists items, handle each one before anything else. The guide describes these as pending actions that must be resolved first. - Follow the session’s events through to the outcome of the turn that was in progress.
- Continue the conversation once the session is in a state that accepts new input.
The session documentation is the reference for the exact field names and event types; check them against the version of the SDK or API you use.
When the session itself has failed
A failed turn does not automatically mean the session has failed. Check the session’s status first. If the session has failed, the recovery guide says to create a new session and supply the inputs that are still needed. Your application should therefore keep enough of the conversation history to rebuild that context, because the failed session cannot be revived. For error handling in general, see the errors and recovery guide linked below.
What does not carry across surfaces
The three surfaces do not share a single resume command. A Claude Code session ID cannot be passed to thread/resume, a Codex thread ID is not an Agents API session ID, and claude --continue has no equivalent in the Agents API. If you use more than one surface, store each identifier under its own name so that a restart never leads you to pass the wrong value to the wrong tool.
Quick Recap
Sources
- Anthropic, Claude Code CLI reference
- OpenAI, Run and continue sessions
- OpenAI, Manage sessions
- OpenAI, Errors and recovery
- OpenAI, Codex app-server sign-in example
“
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




