Last updated 13 October 2026
Find a list of all Claude Code sessions
The challenge of lost context
Developers often face a mental block when returning to a project after a break. You open your terminal and realize you do not remember which branch you were working on or what the last instruction to the agent was. This context loss is expensive because it forces you to spend time re-reading code and checking your git status. You might have several terminal tabs open, each representing a different attempt at solving a bug or implementing a feature. Finding the right conversation history is the first step to regaining your momentum.
Claude Code keeps a record of your interactions, but this history is local to the directory where you ran the command. If you have a complex project with multiple subdirectories, you might have started sessions in different parts of the tree. This makes the search for your previous work even more difficult. You need a reliable way to list these sessions and see exactly what was happening in each one. Without this, you risk duplicating work or missing important context that the agent already processed in a previous run.
Use the resume command to see history
The most direct way to find your previous work is to use the claude --resume command. When you run this in your terminal, it searches the local history for that specific directory and presents a list of sessions. Each entry in the list typically shows a summary of the conversation and a timestamp. This allows you to scroll through your recent history and pick the exact point where you want to pick up the work. It is an essential tool for developers who juggle multiple tasks within the same codebase.
This command is helpful because it does not just show you a list of IDs. It gives you enough information to recognize the specific problem you were solving. For example, if you were using the Grep tool to find a specific function or the Edit tool to modify a configuration file, the summary will reflect those actions. Selecting a session from this list restores the context window, including all the files the agent has already read and the instructions you have already provided. This saves you from having to explain the project requirements all over again.
Resume sessions from the short flag
If you are a developer who values speed and minimal typing, you can use the claude -r flag instead. This is the short version of the resume command and it behaves in exactly the same way. It opens the interactive selection screen where you can use your arrow keys to navigate the history. This is often the fastest way to check if you have an active session that already has the necessary files in its context window. It keeps you in the flow of coding without requiring you to remember long command strings.
Using the short flag is especially useful when you are working in a terminal environment with limited screen space. You can quickly trigger the list, find your session, and get back to the Bash or Read operations that were in progress. If you find that the list is empty, it means no sessions have been recorded in that specific folder yet. This is a clear signal that you need to start a new session or check if you are in the correct root directory of your project.
Continue the most recent session
Sometimes you do not need to see the entire history because you know you only want the very last thing you were doing. In these cases, the claude --continue command is the right choice. This command bypasses the selection screen and automatically loads the most recent session from the current folder. It is designed for the common scenario where you step away for a coffee or a meeting and want to resume your work immediately upon returning. It is the most efficient path to picking up where you left off.
You can also use the shorter claude -c flag to achieve this. This command is a staple for developers who maintain a single, long running session for a major feature. It ensures that the agent retains its memory of the project structure and any custom instructions you might have placed in a CLAUDE.md file. By using the continue flag, you avoid the mental overhead of choosing from a list and can get straight back to issuing prompts or reviewing the agent's proposed plan for the next task.
Terminal history and search
When the built-in commands are not enough, your terminal history serves as a backup. By pressing Ctrl+R in your shell, you can search for every time you have typed the word claude in the past. This will show you the exact directories and flags you used, which is a great way to find where your sessions are located. If you have been working across many different repositories, your shell history acts as a global log of your activity with the tool. This helps you jump back to a directory you might have forgotten.
This method is also useful for finding specific prompts you ran in the past. If you used the claude -p command to run a single instruction without the interactive interface, that command and its prompt will be saved in your shell history. While this does not resume an interactive session, it allows you to see the exact logic you used to query the agent. Combining shell history with the internal session list gives you a complete picture of your workflow and helps you recover from any loss of focus.
Managing sessions with adhdTerminal
Managing multiple active sessions can still feel like a chore even with these commands. This is where adhdTerminal provides a more visual approach to session management. Instead of digging through lists in a single terminal window, adhdTerminal runs many Claude Code sessions side by side as tiles on a wall. Each tile is a distinct session with its own color, number, and name. This layout allows you to see the status of several projects at a glance, showing you whether an agent is working, waiting for you, or idle.
The benefit of this system is that it removes the need to manually run resume commands every time you switch tasks. The tiles are persistent and reopen in the same place after a restart, automatically resuming the sessions they were holding. You can see the last exchanges of each conversation directly on the tile, which provides immediate context without you having to type a single command. For a developer handling several different bugs or features at once, this visual wall replaces the mental burden of tracking terminal tabs and directory paths.
Understand where session data lives
It is useful to understand where the agent looks for its instructions and settings. Claude Code reads from a CLAUDE.md file in your project root to understand your specific coding style and project requirements. If you have a CLAUDE.md file in a subdirectory, those instructions apply specifically to that part of the file tree. This allows you to have different rules for your frontend and backend code within the same repository. There is also a global CLAUDE.md file in your home directory at ~/.claude/CLAUDE.md for rules that should apply to every project you work on.
Your personal preferences are stored in .claude/settings.json within the project folder. If you want to override these settings without tracking them in git, you can use a .claude/settings.local.json file. For settings that you want to persist across all your projects on your machine, you should look at ~/.claude/settings.json. If you ever feel like your session list or configuration is behaving unexpectedly, running the claude doctor command will check your installation and environment to ensure everything is set up correctly.
Clear or compact to manage session size
As you work through a session, the conversation and the files the agent reads fill up the context window. This can eventually lead to a situation where the agent has too much information to process efficiently. You can manage this by using the /compact command. This instruction tells the agent to summarize the conversation so far, which frees up space in the context window while keeping the important details. It is a vital command for long sessions where you have performed many Read and Edit operations.
If a session has reached a point where it is no longer useful, or if you want to start a completely new task in the same folder, you can use /clear. This command wipes the current session context but stays within the same directory. It is different from starting a brand new session because it keeps you in the interactive flow. Using these commands effectively ensures that your sessions remain fast and that the agent does not get confused by old or irrelevant code snippets that are no longer part of your current objective.
Visibility of cost and usage
Monitoring the cost of your sessions is another important part of history management. Every prompt you send and every file the agent reads contributes to your usage. Inside any active session, you can type /cost to see the financial impact of the current conversation. You can also use /usage to see a broader view of your token consumption. Keeping an eye on these numbers helps you decide when it is better to start a fresh session or when a /compact command might help reduce the overhead of a long conversation.
These commands give you transparency and control over your development budget. If you find that a particular task is consuming a lot of resources, you might want to adjust your plan or give the agent more specific instructions in your CLAUDE.md file to minimize unnecessary file reading. By combining the ability to resume old sessions with the ability to monitor their cost, you can maintain a highly efficient and organized development environment. This allows you to focus on writing code while the agent handles the heavy lifting of searching and editing your files.
Questions people ask
How do I delete a session from the resume list?
There is no direct command to delete a single session from the history list. You can use the /clear command to start over in a folder, but the historical record remains. If you need to remove session data for privacy or space, you would need to manually find the local storage folder on your machine.
Can I resume a session from a different directory?
No, the resume command looks for history specific to the folder where you run it. To access a session, you must first navigate to the directory where that session was originally started. This keeps your project histories separate and organized by their respective repositories.
What should I do if the agent stops responding during a session?
You can press the Escape key once to interrupt what the agent is doing if it seems stuck. If you need to go back to a previous point in the conversation, press Escape twice to see a list of earlier messages. You can also use Ctrl+C to quit the session and then use the resume command to try again.
Read next
- Add build instructions to your CLAUDE.md fileImprove project context by adding specific build commands and environment requirements to your CLAUDE.md file for the AI to follow.
- Add common error fixes to CLAUDE.mdImprove project memory by adding a section for common errors and their fixes to your CLAUDE.md configuration file.
- Add custom shell aliases for Claude CodeSpeed up your workflow by creating shell aliases for common Claude Code invocations and project-specific startup commands.
- Add test commands to a CLAUDE.md fileUnderstand how to define specific test runners and environment flags in your CLAUDE.md file so the tool runs the correct test suite.