Try free

Last updated 13 October 2026

Reopen Claude Code after a reboot

Restoring lost terminal sessions

A sudden system reboot breaks your focus and clears your workspace. You might have several terminal windows open at different parts of a codebase while working on a complex feature. One window is debugging a race condition in the backend service. Another window is trying to fix a layout shift in the frontend styles. A third window might be running a search to find every instance of a deprecated function. When the power goes out or an update forces a restart, all those active sessions vanish from your screen. You are left with a blank terminal and a fuzzy memory of the last prompt you sent.

This loss of state is more than just a minor annoyance for a professional developer. It disrupts the context that you and the agent built together over several hours of work. Claude Code remembers the files it read and the tools it used, but you have to manually navigate back to each directory and trigger the resumption of every single task. If you were juggling multiple different problems at once, you have to remember which directory belonged to which specific thought process. The mental load of reconstructing your entire workspace takes away energy from the actual coding work. You need a way to return to your exact state without manual configuration or searching through history.

Resuming the last active session

The primary tool for getting back to work after a crash is the continue flag. You navigate to your project root in the terminal and type the command claude followed by the double-hyphen continue flag. You can also use the shorter version which is the hyphen and the letter c. This command looks for the most recent session associated with that specific directory. It loads the conversation history and the context of the files that were previously accessed. It allows the agent to pick up right where it stopped before the interruption occurred.

This command is effective because it removes the need to re-explain the current task or provide the background of the problem again. If the agent was halfway through a complex Edit tool operation, it will know what the goal was and what changes it had already planned. However, this only works for the very last session in that specific folder. If you were using different terminal tabs for different sub-tasks within the same repository, the continue command will only target the one that was modified last. You must be careful to use this in the correct directory to ensure the agent has access to the right instructions in your CLAUDE.md file.

Selecting specific history entries

When the most recent session is not the one you need to work on, you use the resume flag. Typing the command claude with the double-hyphen resume flag or the short hyphen r version triggers a different behavior. Instead of jumping into the most recent chat, the tool presents a list of previous sessions stored on your machine. Each entry in this list includes a session identifier and usually a brief summary of what the conversation was about. You use the arrow keys to scroll through the history and select the specific thread you want to bring back to life.

This is particularly useful when a reboot happens during a context switch. You might have been working on a feature branch for two hours, then briefly switched to a small bug fix in a different directory before the computer crashed. Using the resume flag allows you to skip the bug fix session and go back to the deep work you were doing on the feature branch. It provides a level of granularity that the continue flag lacks. It ensures that no part of your logic or your previous tool outputs is lost just because it was not the most recent interaction. Selecting the correct session restores the memory of the agent so it can continue acting as your assistant without missing a step.

Preserving project context with files

Project instructions are the backbone of a stable and reproducible environment. The agent looks for a file named CLAUDE.md in the root of your repository every time a session starts or resumes. This file should contain the essential knowledge about your build system, your testing commands, and your coding style. When you reopen a session after a reboot, the agent reads this file again to refresh its understanding of the project. This ensures that the instructions stay fresh and the agent does not start suggesting commands that do not work in your specific environment.

You can also place a CLAUDE.md file in subdirectories if you have a large project with different requirements in different areas. This allows you to have different rules for a backend folder and a frontend folder. If you have global preferences that you want to apply to every single project on your machine, you can place a CLAUDE.md file in a hidden directory in your home folder. This multi-level approach to configuration ensures that the agent always knows the ground rules, regardless of which session you decide to resume. It prevents you from having to repeat your preferences every time the system restarts.

Managing memory and context limits

Every session has a context window that fills up as you interact with the agent. The agent stores the text of your conversation and the content of every file it reads using the Read tool or the Glob tool. After a long day of work, this context can become very large. When you resume a session after a reboot, the agent has to process all that information again to maintain its state. If the context is too full, the agent might become slower or lose track of early details. You can check the current spend and token usage by using the cost or usage slash commands inside the session.

To keep your sessions healthy after a restoration, use the compact slash command. This command instructs the agent to summarize the conversation so far and clear out the unnecessary details while keeping the important facts. It frees up space in the context window and makes the resumption process more efficient. It is a good habit to run this command before you finish work for the day or right after you resume a large session. It keeps the agent focused on the task at hand rather than getting confused by old noise. If you feel the session has become too cluttered to be useful, you can also use the clear command to start over in the same folder.

Automating the restoration process

Managing multiple terminal windows and remembering which flags to use for each task is a significant burden. This is where adhdTerminal provides a direct answer. It is a native app for macOS and Windows that runs many Claude Code sessions side by side. Each session is displayed as a tile on a wall, providing a visual map of your entire project. You can give each tile a specific color, a number, and a name to organize your thoughts. This makes it easy to see exactly what each agent is doing without clicking through dozens of terminal tabs.

The most important feature for handling reboots is the automatic restoration of the wall. When you restart your computer, adhdTerminal reopens and places every tile back in its original position. It automatically resumes the specific session that was running in that tile before the shutdown. You do not have to navigate through directories or search through a list of session IDs with the resume flag. The entire workspace is preserved exactly as you left it. This eliminates the friction of setting up your environment after a crash or a scheduled update and allows you to jump back into your code immediately.

Verifying tool permissions and settings

The behavior of the agent is also governed by your local settings files. Claude Code stores configuration in a hidden directory named .claude within your project. The settings.json file defines how the agent can interact with your system and which tools it is allowed to use. For example, you can set permission modes like acceptEdits or bypassPermissions. These modes determine whether the agent asks for your approval before using tools like Write or Edit. If you have custom requirements for your own machine that you do not want to check into the project repository, you can use a settings.local.json file for your overrides.

After a reboot, it is important to verify that these settings are still being applied correctly to your resumed sessions. You can use the config slash command inside a session to view the current configuration and ensure your overrides are active. If you need to change the permission mode quickly, you can use the Shift plus Tab shortcut to cycle through the available modes. Ensuring your permissions are set correctly prevents the agent from getting stuck waiting for manual approvals on tasks that you have already authorized. This is especially useful when you are running several tiles at once and want the agents to proceed with their tasks independently while you focus on other work.

Synchronizing work across devices

Once you have resumed your sessions, you should verify the state of the work to ensure the agent is on the right track. Use the status slash command to get a high-level overview of what the agent is currently tracking. You can also use the memory slash command to see the specific facts or variables the agent has stored about your project. If something looks wrong after the resume, you can use the Escape key twice to go back to earlier messages and pick a different point to resume from. This gives you a safety net if the restoration process brings back a session that was heading toward a mistake.

For developers who need to stay informed even when they are away from their workstation, adhdTerminal offers a free iPhone app. This app mirrors your wall of tiles over an end-to-end encrypted link, allowing you to monitor your sessions from anywhere. You can check the progress of a long-running task while you are getting a coffee or waiting for your computer to finish its update process. You can even answer a prompt or send the next task directly from your phone to keep the work moving. This creates a continuous workflow that survives reboots and physical moves, ensuring that your development process is never truly interrupted.

Questions people ask

How do I find a session ID if I want to resume a specific chat?

You run the command claude with the resume flag to see a list of all recent sessions. Each entry shows a unique ID along with a short summary of the conversation. You can use the arrow keys to navigate the list and press Enter to select the one you want to restore.

Does Claude Code save my terminal command history after a reboot?

The agent saves the conversation history and the context of the files it has modified, but it does not save the standard terminal scrollback. If you need to see the output of a command that was not captured in the chat, you may need to check your shell history using Ctrl plus R. You can also use the status slash command to see a summary of the current session state.

Can I change my permission settings without restarting the session?

Yes, you can use the Shift plus Tab keyboard shortcut inside an active session to cycle through the different permission modes. This allows you to switch between the default mode and modes like acceptEdits or bypassPermissions. You can also use the config slash command to view or modify your settings.json file while the agent is running.

Read next

More on claude code basics·All posts