Last updated 13 October 2026
Reopen active Claude Code sessions
Losing context breaks your development flow
You are deep into a complex refactor when your operating system decides it is time to install updates and restart. When the machine comes back up, your terminal is blank and the mental map of your progress is gone. You search your shell history to find the right directory, but the specific conversation thread with the agent feels lost. This disruption forces you to re-explain the problem, re-read the files, and hope the agent reaches the same conclusion it had five minutes ago. Losing your place in a coding session is a significant drain on your cognitive energy.
When you are forced to restart your system, the state of your terminal is often the first thing you lose. Even if you have a terminal emulator that restores tabs, the active process is usually terminated. For a command line agent, this means the local context of the current conversation is no longer in the active memory of the shell. You have to navigate back to your project directory and figure out where you were in the task list. This process is time-consuming and prone to errors. You need a reliable way to make these sessions persistent across reboots and software updates.
Command line flags restore previous conversations
Claude Code includes built-in mechanisms to prevent this data loss. If you want to jump back into the exact spot where you left off in your current directory, use the command claude --continue. This flag looks for the most recent session metadata and reloads the context. This command is the fastest way to get back to work after a crash or a simple terminal closure. It restores the conversation history and the files the agent was previously tracking so you do not have to start from scratch.
If you were working on multiple tasks or need to revisit a specific conversation from yesterday, the command claude --resume provides a list of previous sessions. You can scroll through this list to pick the one that matches your current goal. This history management happens automatically, so you do not need to manually save your work before you quit the terminal. The agent stores these sessions in a local database on your machine, ensuring that your work is available whenever you return to the project.
Project instructions provide a permanent memory
Every project should have a CLAUDE.md file in the root directory to act as the source of truth for the agent. This file holds instructions about the build system, coding standards, and project structure. Even if you start a completely fresh session using /clear, the agent reads this file first. This ensures that the context remains consistent even if the session history itself becomes irrelevant. It is a persistent anchor for the understanding of your code that survives any session reset.
You can also place CLAUDE.md files in subdirectories to provide localized instructions for specific parts of the codebase. This hierarchical approach allows the agent to understand the nuances of different modules without losing the overall project context. By maintaining these files, you ensure that any new session starts with a deep understanding of your requirements and preferences. This practice reduces the amount of repetitive instruction you have to provide at the start of a new work session after a computer restart.
Managing multiple projects simultaneously
Managing a dozen different folders with their own sessions is difficult in a standard terminal window. This is where adhdTerminal helps by running many Claude Code sessions side by side. Each session lives in a tile on a wall with a specific colour, number, and name. The tile shows whether the agent is working, waiting for you, done, or idle. It also displays the last exchanges of the conversation so you can quickly see the current status of every task at a single glance.
When your computer restarts, these tiles reopen in the same place and resume the same session automatically. You do not need to remember which folder had which task because the wall preserves your entire mental workspace across reboots. This visual organization prevents the cognitive load of searching through open windows or shell history. The application is a native app for macOS and Windows made by MINDBALANCER OU in Estonia. It costs 99 dollars once and offers a 7 day free trial with no account required.
Global and local settings preserve your working environment
Global and local settings files define how the agent behaves across all your work. You can use ~/.claude/settings.json for your universal preferences and .claude/settings.json for project-specific rules. These files persist regardless of session status or system restarts. If you have custom permission modes or specific tools you want to allow or deny, defining them in these JSON files ensures they are active every time you launch the agent. This removes the need to reconfigure your environment manually.
You can also use .claude/settings.local.json for settings that you want to keep on your local machine without checking them into your repository. This tiered configuration system gives you granular control over the behavior of the agent in every environment. By setting your preferred permission modes or model defaults here, you ensure that every session starts with the correct constraints. This persistence means you never have to spend time re-configuring the tool after an update or a machine swap.
Keeping long sessions efficient with compaction
Long-running sessions eventually fill up the context window with file contents and previous exchanges. When this happens, the agent may become slower or more expensive to run. You can use the /compact command to summarize the conversation so far and free up space in the context window. This creates a condensed version of the history that still allows the agent to understand the current state of the task. It is a way to maintain persistence without sacrificing performance or increasing costs.
Compaction is essential for sessions that span several days or involve many file edits. It helps the agent stay focused on the most relevant information while keeping the historical context available for reference. Regular use of /compact keeps your persistent sessions from becoming bloated and inefficient. If you find the agent is losing track of early details because the context window is full, use /compact to help it re-focus on the core objectives of your current task.
Automating environment setup with hook events
You can automate the setup of your environment by using hook events like SessionStart or UserPromptSubmit. These hooks allow you to trigger specific behaviors every time a session begins or an action occurs. For example, a SessionStart hook could run a script to verify your environment variables or pull the latest changes from your repository. By defining these hooks in your settings, you create a resilient workflow that recovers its state faster than a manual process would allow.
You can also use PostToolUse or Notification hooks to keep track of background tasks. These automation points ensure that the agent always works within a predictable and updated environment, regardless of how many times you have restarted your session. Hook events provide a bridge between the internal state of the agent and your external development environment. They are an effective way to ensure that your persistent sessions are always operating on the most current data and configurations.
Monitoring sessions from your mobile device
If you find yourself needing to check on a long-running task while you are away from your desk, the adhdTerminal ecosystem includes a free iPhone app. This app mirrors your wall over an end to end encrypted link so you can see the status of every tile. You can answer a prompt from the agent or send the next task directly from your phone. This mobility ensures that your sessions stay active and productive even when you are not physically at your computer.
The app reflects the current state of your wall, including the colour, number, and name of each tile. This means you can monitor the progress of a complex build or a large refactor while you are on the move. If a tile changes from working to waiting for you, you can provide the necessary input immediately. This constant connection prevents projects from stalling while you are away from your primary workstation, maintaining the momentum of your work.
Handling software updates without losing progress
Keeping the software updated is necessary for security and performance. When you run claude update, the tool handles the installation of the latest version. This process does not delete your session history or your project-specific settings. After the update finishes, you can use claude --continue to get back to work immediately. Regular updates ensure you have the latest improvements to the tool use and reasoning capabilities of the agent.
If you suspect something went wrong during the update or restart, the command claude doctor checks the installation and identifies issues with your environment or connectivity. This tool can verify that your permissions are set correctly and that the agent can access the necessary APIs. It is a useful first step for troubleshooting any persistence issues. Running claude doctor periodically helps you maintain a stable and reliable development environment for all your coding projects.
Questions people ask
How do I see a list of my old sessions?
Use the command claude --resume to see a chronological list of your previous work. This interface allows you to select a specific session and pick up where you left off. It is a reliable way to recover a session if you forgot which directory you were in.
Where are my custom commands stored?
Your custom slash commands are stored as markdown files inside a directory named .claude/commands. Each file represents a command that you can trigger within a session. This allows you to extend the functionality of the agent for specific project needs and keep those extensions persistent.
Can I use different settings for different folders?
Yes, you can use .claude/settings.json in any directory to apply settings only to that part of your project. For your own personal overrides that you do not want to track in version control, use .claude/settings.local.json. Global settings that apply to every session live in your home directory at ~/.claude/settings.json.
Read next
- Access git submodules in Claude CodeFix issues where Claude Code cannot see or modify code located inside nested git submodules within your main repository.
- Allow Claude Code to run shell scriptsResolve tool execution errors by adjusting permission settings to let Claude Code execute local bash or powershell scripts in your terminal.
- Break a linter error loop in ClaudeWhat to do when Claude Code fixes one linting error only to create another, leading to a circular set of edits.
- Change the Node version for Claude CodeResolve compatibility issues by switching the Node.js version used by Claude Code without breaking your other local development tools.