How to Save and Resume Claude Code Conversations (2026): Sessions, Export & Recovery

How to Save and Resume Claude Code Conversations (2026): Sessions, Export & Recovery

Quick Answer

You spend hours debugging a project in Claude Code, discover the cause of a difficult issue, and then close your terminal. The next day, you need to continue without explaining everything again.

The good news is that Claude Code automatically saves normal CLI conversation sessions locally, allowing you to return to previous discussions and continue development work.

But saving a session, resuming it, exporting its contents, and recovering lost context are different tasks. Understanding those differences helps prevent missing conversations and unnecessary repetition.

This guide covers Claude Code session history, claude --continue, claude --resume, /resume, /export, session naming, branching, local transcript storage, and troubleshooting.

How Do You Save and Resume a Claude Code Conversation?

Claude Code automatically saves normal interactive conversations to local session transcripts. To reopen your latest session, run claude --continue from the project directory. To choose an older session, run claude --resume or use /resume inside Claude Code. To save a readable copy outside the session system, use /export.

Table Of Content

Claude Code Save Conversation: Quick Command Reference

Claude Code provides several ways to return to earlier work. The right command depends on whether you want to continue the latest session, search older conversations, export a transcript, or create an alternative branch.

Command

Where to run it

What it does

claude --continue

Terminal

Resume the most recent session in the current project

claude -c

Terminal

Short form of --continue

claude --resume

Terminal

Open the interactive session picker

claude -r

Terminal

Short form of --resume

claude --resume my-session

Terminal

Resume a session with an exact matching name

/resume

Inside Claude Code

Switch to a previous conversation

/rename my-session

Inside Claude Code

Assign a descriptive name to the current session

/export

Inside Claude Code

Save a readable conversation copy or copy it to the clipboard

/export session-notes.txt

Inside Claude Code

Export the conversation directly to a named text file

/compact

Inside Claude Code

Summarize older context while continuing the session

/clear

Inside Claude Code

Start a fresh conversation without deleting the previous saved session

/branch experiment-name

Inside Claude Code

Create a separate conversation branch

/rewind

Inside Claude Code

Review earlier checkpoints and available restore options

The most important distinction: --resume continues a saved conversation, while /export creates an external, readable copy. An exported text file is not automatically a resumable Claude Code session.

Does Claude Code Automatically Save Conversations?

Yes. In a normal interactive CLI session, Claude Code writes its conversation history to local transcript files as you work.

This means you usually do not need to press Save after every message or manually export the conversation before closing the terminal.

What is stored in a session?

A normal Claude Code session transcript can contain:

  • User prompts.

  • Assistant responses.

  • Tool calls and their results.

  • Session-related metadata.

  • Information needed to reconstruct the conversation.

A resumed session may also restore certain saved session settings and working context.

However, a session transcript is not a complete backup of your source-code repository.

Your project files exist separately on disk. Changes to those files should be reviewed and protected using Git or another appropriate version-control system.

Session vs. project files vs. persistent instructions

Item

Main purpose

Where it belongs

Session transcript

Preserve an interactive conversation

Claude Code's local session storage

Project source files

Store the actual application code

Your repository or project directory

CLAUDE.md

Store reusable project instructions

Project or user instruction locations

Exported transcript

Create a portable, readable conversation record

A file you choose

Git commits

Preserve versions of source-code changes

Your Git repository

These records serve different purposes.

For example, continuing a conversation does not restore a deleted source file. Likewise, committing code does not automatically preserve every prompt and response from your Claude Code session.

Step 1: Resume the Most Recent Claude Code Session

The easiest way to resume a conversation is the --continue command.

Example: Continue work on an existing website

Imagine you were using Claude Code to investigate a navigation bug in a Next.js website.

You exit the terminal after identifying the issue but before completing the fix.

The next day, open a terminal and navigate to the same project:

Then run:

Or use the short version:

Claude Code attempts to resume the most recent eligible session associated with that project.

What should happen?

The previous conversation opens, allowing you to continue discussing the same task.

A useful follow-up prompt is:




This is safer than assuming the working directory and source files are exactly as they were during the previous session.

When should you use --continue?

Use it when:

  • You were working on one project recently.

  • You want the latest saved conversation.

  • You do not need to search through several older sessions.

  • You are returning to the same general workflow.

If you have multiple sessions, use --resume instead to avoid opening the wrong one.

Step 2: Find and Resume an Older Conversation

A project may have several Claude Code sessions.

For example, you might use different conversations for authentication, API development, landing page changes, and automated tests.

In that situation, the latest session may not be the one you want.

Open the session picker

From your project directory, run:

Or:

Claude Code opens an interactive picker containing eligible saved sessions.

Depending on the current version, the picker can show session names, generated titles, recency information, Git branches, and previews.

How to find the right conversation

  1. Open the session picker.

  2. Look for a relevant title or recent activity.

  3. Use the search function to narrow the list.

  4. Preview a session where supported.

  5. Select the intended conversation.

  6. Press Enter to resume it.

Useful session picker shortcuts

Shortcut

Action

Up / Down

Move through the session list

Enter

Resume the selected session

Space

Preview the highlighted session

Ctrl+R

Rename a highlighted session

Ctrl+A

Expand the picker to sessions across all projects

Ctrl+W

Include worktrees associated with the repository

Ctrl+B

Filter sessions to the current Git branch

Esc

Exit the picker or its search mode

Some picker features depend on the installed Claude Code version.

Resume from inside an active conversation

You can also enter:

This switches to another saved session without requiring you to exit Claude Code and relaunch it manually.

For newer Claude Code versions, selecting an actively running background session may attach you to that running session rather than independently reloading its transcript.

For regular local development, the key principle remains simple: use the picker when you need to choose a specific conversation instead of automatically resuming the most recent one.

Step 3: Rename Conversations So You Can Find Them Later

Naming sessions is one of the simplest ways to improve a multi-project Claude Code workflow.

An automatically generated session title may describe the first prompt rather than the work that became important later.

A descriptive manual name makes future sessions easier to identify.

Rename the current session

Inside Claude Code, run:

You can use another short, meaningful name:

For example:

Resume the named session

From your terminal, run:

Or inside another session:

The name must match the intended session. If several sessions have ambiguous names, the interactive picker can help resolve the choice.

Start a named session immediately

Claude Code also supports naming a new session at startup:

The short form is:

Recommended naming convention

For developers working across SaaS products and websites, a consistent naming approach helps:

Example session name

Purpose

marketing-site-redesign

Marketing website changes

auth-refactor

Authentication changes

checkout-api-debug

Payment API investigation

cms-content-import

CMS migration testing

release-qa

Final release verification

Names should identify the work, not include passwords, customer secrets, or other sensitive information.

Step 4: Export a Claude Code Conversation to a Text File

Sometimes you don't want to resume a conversation. You want a copy that someone else can review.

Examples include:

  • Sharing debugging notes with a teammate.

  • Saving an investigation for a project handoff.

  • Preserving a record before a major refactor.

  • Creating notes for a technical article.

  • Keeping an external archive of important discussions.

For these purposes, use /export.

Open the export menu

Inside an active Claude Code conversation, enter:

Claude Code opens an export flow that allows you to save the transcript as readable text or copy it to the clipboard.

Export directly to a named file

Enter:

Claude Code writes a readable transcript to the specified file.

Use an appropriate path if you want the file saved in a specific directory.

For example:

The destination directory should already exist and be writable.

What does the export contain?

The export presents conversation messages and tool output in a readable format.

It is intended for human review.

By contrast, the underlying local session transcript uses structured JSON Lines data maintained by Claude Code.

Important differences between resume and export

Feature

Resume a session

Export a transcript

Main purpose

Continue an earlier conversation

Save or share a readable record

Primary command

claude --resume

/export

Uses Claude Code session storage

Yes

Reads current conversation and writes an output

Can continue directly from exported text

No

No, not as a normal resumable session

Suitable for sharing

Not the primary workflow

Yes, after checking sensitive content

Useful as a human-readable archive

Not primarily

Yes

Preserves source-code files

No

No

Do not confuse an exported transcript with a project backup.

If the project is important, separately preserve the source code, configuration, assets, and any relevant external data.

Step 5: Where Does Claude Code Store Conversation History?

Claude Code stores normal local CLI transcripts in a directory within the user's Claude configuration area.

The default structure is:

~/.claude/
└── projects/
    └── <project-identifier>/
        ├── <session-id-1>.jsonl
        ├── <session-id-2>.jsonl
        └── <session-id-3>

~/.claude/
└── projects/
    └── <project-identifier>/
        ├── <session-id-1>.jsonl
        ├── <session-id-2>.jsonl
        └── <session-id-3>

~/.claude/
└── projects/
    └── <project-identifier>/
        ├── <session-id-1>.jsonl
        ├── <session-id-2>.jsonl
        └── <session-id-3>

The ~ symbol represents your home directory.

Example macOS or Linux location

Example Windows location

%USERPROFILE%\.
%USERPROFILE%\.
%USERPROFILE%\.

The actual project subdirectory is derived from the working directory path.

Claude Code converts non-alphanumeric characters in the path into hyphens and applies additional handling for unusually long names.

This means the storage folder is not always simply the repository's short name.

What is a JSONL transcript?

JSONL stands for JSON Lines.

Each line in the file contains a separate JSON object representing a message, tool interaction, or other recorded event.

A highly simplified example might look like:




This is an illustrative representation, not an exact copy of Claude Code's internal transcript schema.

Anthropic warns that the internal transcript format can change between releases. Avoid building critical integrations around assumptions about the structure of every JSONL field.

Use officially documented session commands and programmatic interfaces where possible.

Does Claude Code upload the entire conversation as a shared team history?

A local transcript is not automatically a shared team conversation database.

Different teammates generally have their own local session records.

Also, Claude Code's CLI, web, desktop and editor integrations do not necessarily present the same session list in the same way.

Some interfaces support handoff or resuming from another surface, but you should not assume that every session created in one interface automatically appears in every other interface.

Step 6: How Long Does Claude Code Keep Conversations?

Claude Code's local transcript retention is configurable.

For the normal local retention cleanup process, the documented default is 30 days.

This is important when you expect to reopen a conversation months later.

What does the 30-day retention rule mean?

Claude Code has a cleanup mechanism that removes eligible old local session data according to the configured retention period.

An exported text file that you deliberately save outside Claude Code's managed session storage is a separate file, subject to your own storage and deletion policy.

Do not assume a local session remains resumable indefinitely.

Change the retention period

Anthropic documents a setting named:

cleanupPeriodDays

For example, a user who wants a longer local retention period could configure the following in ~/.claude/settings.json:




This example sets the relevant retention period to 90 days.

If the settings file already contains other options, add the field without replacing unrelated configuration.

The setting may be overridden by an organization's managed policy.

What if the conversation was already deleted?

Increasing cleanupPeriodDays does not recreate files that have already been removed.

If the original local transcript is gone, the built-in resume command generally cannot recover that conversation.

An earlier exported copy, a separate authorized backup, or project documentation may still be available.

Long-term retention recommendation

For significant projects:

  1. Name important sessions.

  2. Export a readable record when necessary.

  3. Keep source code in version control.

  4. Maintain a short project progress document.

  5. Follow organizational retention and privacy policies.

Do not increase retention indiscriminately when transcripts may contain sensitive data.

Step 7: Resume a Session by ID or Transcript Path

Most users can rely on the session picker.

For automation, debugging, or environments with many sessions, resuming by identifier can be useful.

Resume by session ID

claude --resume <session-id>
claude --resume <session-id>
claude --resume <session-id>

Replace <session-id> with the actual identifier.

For example, an identifier might be a UUID generated by Claude Code.

Do not use a placeholder as a real session ID.

Resume from an absolute transcript path

Current Claude Code documentation also supports:

Use this when you have a valid Claude Code transcript that needs to be opened from a known path.

This does not mean that an ordinary text export can be renamed to .jsonl and resumed.

The file must be a valid Claude Code session transcript.

What happens if the session belongs to another project?

Current Claude Code versions can search for a matching session ID across local project storage.

The precise resume behavior can depend on worktrees, the current directory, and whether the original project still exists.

After resuming a session in a different working environment, inspect the repository path and relevant files before making changes.

Step 8: What Does Claude Code Restore When You Resume?

Resuming a saved session can restore more than the latest assistant message.

The transcript provides the conversation history and recorded tool interactions.

Depending on the session and configuration, Claude Code also restores certain session state.

However, this is not equivalent to restarting an interrupted computer process from its exact execution point.

What is typically restored?

Item

Expected behavior

Saved conversation messages

Restored from the transcript

Recorded tool interactions

Available as saved conversation context

Compaction summary

Used when the previous conversation was compacted

Model selection

Generally restored, subject to model availability and settings

Certain permission modes

May be restored or overridden according to current rules

Project source files

Remain on disk in their current state

Tool call interrupted by a crash

Not automatically guaranteed to finish

Background shell commands

Not automatically restarted just because the transcript resumed

Every original CLI flag

Not guaranteed; some must be supplied again

Example: Recover after a terminal crash

Suppose Claude Code was running tests when your terminal closed unexpectedly.

You reopen the session:

Do not immediately ask Claude to repeat every unfinished action.

Instead, ask:




An interrupted command may have changed files or external systems before the session ended.

Blindly repeating it can create duplicate work or unintended side effects.

Resume is not process recovery

A resumed conversation retains useful context, but a disconnected background command, lost terminal process, or expired external connection may need separate handling.

Treat the conversation as a record of the previous work and verify the present environment.

Step 9: Manage Long Claude Code Conversations with /compact

A saved conversation can become very long.

Claude Code models have a finite context window—the amount of conversation and supporting information they can consider at one time.

As a session grows, Claude Code may compact older context so that the conversation can continue.

Check context usage

Inside Claude Code, enter:

This displays information about the current context usage.

Compact the conversation

Run:

Claude Code summarizes earlier material while keeping the current session active.

You can also provide instructions about which information matters most:




This is useful when the session contains a long investigation but you still want to continue the same task.

Does /compact delete the transcript?

Compaction changes which information is actively included in the model's context.

The original session transcript can retain records of earlier messages until local retention or another applicable deletion mechanism removes them.

However, a resumed model does not necessarily receive every original message that was summarized during compaction.

Therefore, critical requirements should also be stored in project documentation or other appropriate records.

When to use /compact

Use it when:

  • You are continuing one large task.

  • The session contains excessive debugging output.

  • Older discussion can be summarized safely.

  • You need to preserve the current working direction.

  • You want to reduce context pressure without switching projects.

For an unrelated task, a fresh session may be cleaner.

Step 10: /clear vs. /compact vs. /resume

These three commands are frequently confused.

Command

Main purpose

What happens to the conversation?

/compact

Reduce active context

Continues the current session with summarized history

/clear

Start a fresh conversation

Ends the current conversation context and starts a new session

/resume

Return to a saved session

Loads or switches to a previous conversation

Example: Switching from API debugging to design work

You finish an authentication investigation.

Then you want to discuss a completely unrelated homepage design.

Using /clear gives you a fresh conversation without carrying the old debugging discussion into the new task.

The previous session remains available for resuming while its transcript exists.

Example: Continuing a long debugging task

You are still investigating the same issue, but the conversation contains many test outputs.

Use /compact to preserve a summarized working context.

Example: Returning to yesterday's discussion

Use /resume to select the earlier session or claude --continue to return to the latest appropriate one.

Decision rule: Compact to continue the same topic; clear to start fresh; resume to return to previous work.

Step 11: Create a Conversation Branch Without Losing the Original

Sometimes you need to experiment with a different implementation approach.

For example, you may want to compare two solutions for a SaaS application's authentication flow.

Rather than mix both investigations into one growing conversation, create a branch.

Create a branch inside Claude Code

Claude Code creates a separate conversation branch and switches to it.

The original session remains available.

Create a branch from the terminal

You can also use:

This resumes the recent conversation as a separate session with its own history.

Branching vs. resuming

Action

Effect

Resume

Continue an existing conversation

Branch

Create a new conversation path based on existing history

Rewind

Return to an earlier conversation or supported code checkpoint

Export

Save a readable record outside the session system

Important file-safety warning

Branching a conversation does not automatically create an independent copy of your working directory.

If two sessions edit the same local files, their changes may overlap.

For truly independent coding experiments, use Git branches, separate worktrees, or another suitable source-control strategy.

Example: Two implementation approaches

You have an existing conversation named auth-refactor.

Create a branch named auth-passkeys.

Use it to explore passkeys while preserving the original session's conversation history.

If you later decide against the experiment, resume the original conversation.

Before returning to the original work, inspect the actual repository state. Conversation separation does not guarantee file-system isolation.

Step 12: Recover Code or Context with /rewind

Claude Code includes checkpointing for supported code edits.

This can help when a recent change produces an unwanted result.

Open the rewind menu

Inside Claude Code, run:

Or use the documented double-Escape shortcut when the input is empty.

The rewind menu presents earlier prompts and available recovery options.

Depending on the checkpoint, you may be able to:

  • Restore the conversation.

  • Restore tracked code changes.

  • Restore both code and conversation.

  • Summarize part of the conversation.

  • Exit without changing anything.

What does checkpointing track?

Claude Code tracks edits performed through its supported file-editing tools.

It does not provide a complete record of all actions performed by shell commands, other applications, external services, or background agents.

For example, if a Bash command deletes a file, you should not assume /rewind can recover it.

Why Git still matters

Use Git to preserve important source-code versions.

Checkpointing helps with certain session-level changes, but Git provides a separate, explicit version-control workflow.

For critical projects, treat them as complementary safeguards.

Step 13: How to Fix a Claude Code Session That Won't Resume

A missing or unresumable session is not always evidence that the transcript has been deleted.

Start by determining whether you are looking in the wrong project, using a different configuration directory, or trying to resume a session excluded from the normal picker.

Troubleshooting matrix

Problem

Possible cause

Recommended action

claude --continue opens the wrong session

A newer conversation exists

Use claude --resume to select the correct one

Older session is missing from the picker

Different project, worktree, filtering, or retention

Expand picker scope and check storage

No conversation found with session ID

Invalid ID, unavailable transcript, or ambiguous local copies

Verify the real ID and transcript location

Session appears but cannot be loaded

Damaged, missing, or incompatible transcript

Check the error and available backups

Conversation resumed but files changed

Source files were modified separately

Review Git status and the current workspace

Resumed session lacks prior launch options

Certain CLI flags are not automatically restored

Supply the required flags again

Export command did not create the expected file

Incorrect destination or unwritable path

Check the filename and directory

Session history disappeared after an extended period

Retention cleanup may have removed the transcript

Check external exports or backups

Non-interactive session missing from picker

Some -p and SDK sessions are excluded

Resume by explicit session ID where supported

Session was deliberately not persisted

Persistence was disabled

A missing transcript may not be recoverable

Troubleshooting procedure

1. Verify Claude Code itself works.

2. Open the full session picker.

3. Expand the search scope.

Use Ctrl+A in the picker to include all local projects when supported.

4. Check your working directory.

Confirm that you are in the expected repository.

5. Inspect local transcript storage.

If the session still cannot be found, examine your Claude configuration directory carefully.

6. Review retention and persistence settings.

Check whether the transcript should still exist.

7. Try the explicit session ID or transcript path.

Use the official resume syntax when you have a valid identifier.

Special case: Non-interactive sessions

Sessions created with claude -p or the Agent SDK are not always included in the normal interactive picker.

If their transcripts exist, they may still be resumable through an explicit session ID.

Do not assume a session has been deleted simply because it is missing from the default list.

Special case: CLI and editor sessions

The CLI and supported editor integrations can share relevant conversation history, but the visible session list depends on the interface.

For example, an editor may show sessions through its own UI while the CLI picker uses project-based local transcript discovery.

If you cannot find a conversation, verify which interface created it and consult the official documentation for that environment.

Step 14: Can You Recover a Deleted Claude Code Conversation?

Recovery depends on what was lost.

There are several different scenarios.

Scenario A: You closed the terminal

Usually straightforward: reopen the saved session using --continue or --resume.

Scenario B: You ran /clear

The earlier conversation is normally still saved and can be reopened while its transcript is available.

Scenario C: The active context was compacted

You can continue from the available summary and subsequent messages.

The complete older discussion may not be loaded into the active context again, even if some records remain in the stored transcript.

Scenario D: The session transcript was deleted

Claude Code cannot resume a session from a file that no longer exists.

Check whether you previously exported the conversation or maintain a separate authorized backup.

Scenario E: Source files were overwritten

Recover them through Git, backups, or supported checkpoints where applicable.

Resuming an earlier conversation alone does not restore the old file contents.

Scenario F: An external action was performed

Changes to a database, remote repository, cloud deployment, or third-party service may require that system's own history or recovery process.

A local conversation transcript does not automatically reverse external changes.

The main lesson: Recovery requires identifying whether you lost conversation text, active context, local code, or external state. Each has a different recovery method.

Step 15: How to Back Up Important Claude Code Sessions

For ordinary work, automatic local session storage is convenient.

For important debugging projects or long-running development engagements, a separate backup process can be useful.

Recommended backup workflow

  1. Give the session a descriptive name.

  2. Export a readable copy after major milestones.

  3. Store the file in an approved, access-controlled location.

  4. Remove or redact sensitive information before sharing.

  5. Commit relevant source-code changes through Git.

  6. Maintain a project summary identifying decisions and remaining work.

  7. Review the applicable session retention settings.

Example project handoff structure




This is an illustrative document organization.

It does not replace repository backups or secure storage policies.

Security consideration: Transcripts can contain sensitive information

Claude Code transcripts may contain commands, file contents, tool responses, and information retrieved during development.

According to Anthropic's local-data documentation, transcripts and history are not automatically encrypted at rest by Claude Code.

Review their contents and permissions before exporting, backing up, or sharing them.

Do not publish raw transcripts containing tokens, credentials, customer data, or confidential project details.

Step 16: Example Workflow — Continue a SaaS Project Across Three Days

The following is a practical example of how developers can combine named sessions, resuming, context management, and exports.

It is an illustrative workflow, not a report of a completed customer project.

Day 1: Investigate the problem

Open the application repository:




Ask Claude to investigate a reproducible login issue without modifying files initially.

After reviewing the findings, authorize suitable code changes and tests.

Before ending the session, ask:




Then export the discussion if a readable external record is needed:

Exit the CLI normally.

Day 2: Resume the investigation

Return to the repository:




Ask:




After additional work, use /compact if the same conversation becomes excessively long.

Day 3: Try an alternative solution

Inside the saved conversation, create a branch:

Discuss a different implementation approach.

If you need actual code isolation, create a suitable Git branch or worktree before making independent changes.

Return to the original discussion using /resume when appropriate.

What this workflow accomplishes

  • A named session is easy to locate.

  • Existing context remains available.

  • A readable transcript can be saved separately.

  • Long discussions can be compacted.

  • Alternative approaches can be explored without losing the original conversation path.

  • Source-code state is still protected through a separate Git workflow.

This is more reliable than relying exclusively on an unnamed terminal conversation and hoping to remember everything later.

Claude Code Session Management Best Practices

Use the following checklist for important development work.

  • I launch Claude Code in the intended project directory.

  • Important conversations have descriptive session names.

  • I use --continue for the latest session and --resume for older ones.

  • I verify the repository state after reopening an interrupted task.

  • I use /compact for long discussions that should continue.

  • I use /clear when beginning an unrelated task.

  • I understand that /export is a readable copy, not a resumable session file.

  • Important project decisions are documented outside the transcript.

  • Code changes are protected through version control.

  • I know the session retention policy that applies.

  • I review transcripts for sensitive information before sharing.

  • I use conversation branching and file-system isolation appropriately.

  • I do not assume a resumed session restarts interrupted commands.

  • I preserve important external data separately.

  • I verify the current official commands after major Claude Code updates.

Common Mistakes When Saving Claude Code Conversations

Looking for a mandatory /save command

Normal interactive CLI sessions are saved automatically.

Use /export when you want a readable external file, not as a required step before every exit.

Confusing saved sessions with persistent project memory

A conversation transcript records session history.

A CLAUDE.md file contains reusable instructions that can be loaded across sessions.

They are not interchangeable.

Assuming /compact preserves every detail in active context

Compaction summarizes information. Important context may no longer be available in full within the model's current context window.

Record critical details outside the conversation when necessary.

Assuming /clear permanently deletes the previous session

Clearing the active conversation and deleting its stored transcript are different actions.

The previous session can usually be resumed while it remains available.

Exporting sensitive conversations without reviewing them

A transcript may contain configuration values, internal URLs, logs, or sensitive text.

Check its contents before uploading or sharing it.

Resuming after a crash and rerunning everything

A tool call may have partially completed.

Inspect the working directory and external systems before repeating commands that could change data.

Treating conversation branching as Git branching

A conversation branch creates a separate discussion path.

It does not guarantee that source-code changes happen in separate worktrees.

Ignoring the retention policy

Local session files are not necessarily retained forever.

Export important discussions when required and store them securely according to project policy.

Final Recommendation: Save, Resume, and Protect the Right Things

Claude Code already handles the routine task of saving normal interactive session transcripts.

For everyday development, use claude --continue to return to your latest conversation or claude --resume to choose an earlier one.

Name sessions that matter. Export important conversations when a portable record is useful. Use /compact to manage long discussions and /branch when exploring alternative approaches.

Most importantly, treat the conversation, source code, and external project data as separate assets.

A saved conversation preserves discussion history. A reliable development workflow also preserves code, decisions, credentials, and recoverable project state.

Official References and Further Reading

Related reading: Need the CLI first? Follow our Claude Code setup guide before managing saved sessions.

FAQs

Does Claude Code automatically save conversations?

Yes. Normal Claude Code CLI sessions are saved automatically to local transcript files as you work. You do not need to run a separate save command after every message. Saved sessions remain available for resuming while their transcript files exist and the relevant retention and persistence settings allow it.

How do I resume a previous Claude Code conversation?

Run claude --continue or claude -c from your project directory to reopen the most recent eligible session. To select an older conversation, use claude --resume in your terminal or /resume inside Claude Code. You can also resume a named session using claude --resume <session-name>.

How do I export a Claude Code conversation to a file?

Open the conversation inside Claude Code and enter /export. Choose the option to save a readable transcript or copy it to the clipboard. You can also use /export session-notes.txt to specify a filename directly. An exported text file is useful for documentation and sharing, but it is not automatically a resumable Claude Code session.

Where are Claude Code conversations stored, and how long are they kept?

Claude Code normally stores CLI session transcripts as JSONL files under ~/.claude/projects/<project>/. The documented default local retention period is 30 days, configurable using cleanupPeriodDays in Claude Code settings. Organization policies may override local preferences. Important sessions should be exported or backed up securely before their transcripts expire.

Can I recover a lost or deleted Claude Code session?

If the terminal closed or you used /clear, the previous conversation can usually be resumed while its transcript remains available. Check claude --resume, the correct project, and the session picker filters. If the transcript was permanently deleted or never persisted, Claude Code generally cannot reconstruct it. Check existing exports or authorized backups.

Author

Shailesh Thakor
Shailesh Thakor

Webflow & Framer Developer | Web Design & SEO Enthusiast

Shailesh Thakor is a Webflow and Framer developer specializing in modern, responsive websites and user-friendly digital experiences. His interests include website performance, technical SEO, AI-powered tools, and SaaS technologies. Through 8Spark, he shares practical insights into website builders, digital tools, and emerging technologies, with a focus on helping businesses and individuals make informed technology decisions.