If a computer restart closes your terminal, Claude Code and Codex may still have saved session history you can reopen. This guide shows how to find and resume a session, return to its project directory, and recover when the expected conversation is missing.
What You’ll Need
- The same user account and computer profile you used before restarting, or access to the home directory where the tool stored its session data.
- A terminal and the project folder associated with the session.
- Claude Code or Codex installed and signed in as needed. A session may not resume if its local history was deleted or stored somewhere you can no longer access.
Step-by-Step
- Open a terminal and return to the project folder. Change to the directory where you were working before the restart. For example, use
cd /path/to/project, replacing the path with the real one. If you do not know it, check your shell history or open the folder in your file manager and use its terminal option. Starting from the right directory helps each tool associate the session with the correct project. - Check that the project is available. Run
pwdto print the current directory, then usels(macOS/Linux) ordir(Windows) to check its contents. If the project is on an external drive or network location, make sure it is mounted and accessible. Do not start a new conversation in a different folder if you specifically need the old session context. - Resume Claude Code. Run
claude --resumefrom the project directory. Claude Code should show resumable conversations so you can select one. Choose the session by checking its prompt or other identifying details. If you already know the session ID, runclaude --resume SESSION_ID, replacing the placeholder with the actual ID. You can also useclaude --continueto continue the most recent conversation associated with the current directory. - Confirm the Claude Code session is the right one. Check the conversation context before asking it to make changes. If the resumed session is not the one you need, exit without making edits and try
claude --resumeto select another entry. The continue option targets the latest relevant conversation, so it is less precise when you have several recent sessions. - Resume Codex. From the same project directory, run
codex resume. Select the session you want from the list. To resume the most recent session, usecodex resume --last. If your installation supports resuming by session ID, usecodex resume SESSION_ID; checkcodex resume --helpif the command or options differ in your installed version. - Verify the Codex context. Review the project and conversation details shown after resuming. If the wrong session opened, return to the session list and select the intended one. Do not assume that “last” means the last session you remember: it may refer to the latest session available to Codex in the current context.
- Check the working tree before continuing. If the project uses Git, run
git statusto see whether files have uncommitted changes. A restart usually does not erase saved edits, but a resumed conversation is not a substitute for checking the files themselves. If you need to preserve work, avoid overwriting changed files and make a backup or commit according to your normal workflow. - Continue with a clear checkpoint. Once you have verified the session, briefly state what you want to do next and mention any important state you have confirmed, such as the current branch or files changed. If the session history does not contain the latest work, summarize it from your notes or the project files rather than assuming the tool remembers it.
Common Mistakes
- Running the command outside the project. Tools may list different sessions or fail to associate a conversation with the intended working directory. Change into the project folder first.
- Confusing “continue” or “last” with a specific session. These options choose the latest available session, which may not be the one you want. Use the interactive list or a session ID when accuracy matters.
- Expecting a restart to preserve unsaved terminal state. Session history can survive while shell variables, running processes, temporary files, and uncommitted edits have separate persistence rules. Check the actual project files.
- Using another account or installation. Session data may be stored locally under the original operating-system user profile. Switching users, containers, machines, or environments can make it appear missing.
- Deleting local data while cleaning up. Removing application data or session files can remove the history needed for resuming. Back up important project work independently; do not edit internal session files to try to repair them.
Tips
- Record the project path and session ID when a conversation is important. Treat IDs as useful references, not as backups of your code.
- Use Git commits or another reliable backup method for work you cannot afford to lose. Conversation history does not guarantee that every file edit was saved.
- When more than one project is open, resume from each project’s own directory and verify the session before allowing file changes.
- If a command is unavailable, check the installed tool’s help output and update or reinstall only through its normal installation method. Command options can vary between releases.
Troubleshooting
No sessions appear: Confirm that you are using the same operating-system account and project directory as before. Check that the tool is installed and available in the current terminal, then try its resume command from the project folder. A different environment, profile, or deleted local session data can explain an empty list.
The command is not recognized: Check installation and the terminal’s PATH, then open a fresh terminal and try again. Use claude --help or codex --help to see whether the installed command offers a resume option. Do not assume instructions for a different release apply unchanged.
The wrong session opens: Exit the conversation without making changes and use the interactive session picker. For Claude Code, prefer claude --resume over claude --continue when you need to choose among sessions; for Codex, use codex resume rather than --last.
The project or files look different: Check pwd, the Git branch, and git status. You may have opened a different copy, branch, or worktree. Locate the original project before proceeding; do not overwrite files to make the resumed conversation appear consistent.
The history is genuinely gone: Look for backups, Git history, notes, or another user profile where the original session was stored. If it cannot be recovered, start a new conversation in the correct project and provide a concise summary. Session recovery cannot restore data that has been permanently deleted.
Frequently Asked Questions
Does restarting my computer delete Claude Code or Codex sessions?
No, a restart alone generally does not delete locally saved session history. It may be unavailable if you changed accounts or environments, or if the data was removed.
Can I resume without opening the project folder first?
You can try, but starting in the original project directory is the practical choice because session selection and project context may depend on it.
What is the difference between resume and continue?
Resume lets you select a session or identify one; continue typically opens the latest relevant session. Codex’s --last similarly selects the most recent available session.
Can I resume a session on another computer?
Only if the required session data and project are available there through a supported setup. A session ID alone does not transfer local history or project files.
Will resuming restore unsaved changes?
Not necessarily. Check the project files and Git status. Session history and saved file contents are separate, so use backups or version control for important work.
What if the resume command’s syntax differs?
Run the tool’s --help command and follow the options shown by your installed version. If no resume option is available, check that the expected tool is installed and current.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Immortals Fenyx Rising Co-op, Crossplay and Friends
- AI Inference Near the Device: When It Makes Sense
- Restore Default Settings on a Sons of the Forest Server
- Best Music Streaming Service in India: How to Choose
- How to Clean Gaming Headset Ear Pads Safely
- First Light Trophy List and How to Earn Them