---
title: "How to save a Claude Code conversation: Export and resume"
description: "Learn how to save a Claude Code conversation using /export, resume sessions with CLI commands, and back up your chat logs safely. Follow our guide."
---

# How to save a Claude Code conversation: Export and resume

Published: 2026-09-28T07:41:26.762Z

Author: [Goon Nguyen](/author/goon)

Reading time: 10 minutes

Learn how to save a Claude Code conversation using /export, resume sessions with CLI commands, and back up your chat logs safely. Follow our guide.

# How to save a Claude Code conversation: Export, resume and back up sessions effectively

Claude Code CLI automatically saves your session history locally, allowing you to seamlessly pick up where you left off. However, automatic persistence is not a substitute for a true backup. To keep a readable copy of your discussion, select an earlier session, or safely preserve work before changing environments, you need to know how to export and resume your sessions using native commands like `/export`, `claude --continue` and `claude --resume`.

![Image](https://cdn.agentkit.best/blog/cfai-media/e7733ed05eb927ac4098c795f0d3946962f7aa9e6e589b44a7dc3d151739de81-18fdff5975b8ef8acb6be2e169ec57d4dfb9af6694b5ddb80757d2426a53ec26.jpg)

## Claude Code save conversation commands

There is no single universal “save” action. These [Claude Code](https://agentkit.best/blog/claude-code-guides/what-is-claude-code-a-complete-guide-to-the-ai-coding-tool) commands address different goals: Reading, continuing, finding, and preserving conversations.

Which command should most users choose?

## Does Claude Code save conversations automatically?

Yes, normal persistent CLI sessions save conversation history locally without a manual save button. Exiting normally does not, by itself, remove that history. Returning from the same project directory helps you locate the applicable session, although storage settings, cleanup, and the environment affect what remains available.

### What automatic saving preserves

Local session storage can include:

Do not assume every tool result is retained in full.

### What automatic saving does not guarantee

Stored history is different from the context window: The limited information available to the model while responding. Older material may be summarized rather than remain fully active. Automatic saving also does not guarantee permanent retention, cross-device access, identical history across interfaces, or a ready-to-share document.

Anthropic’s Claude Code settings documentation describes retention-related controls. Local files also do not mean Claude Code processes everything offline or locally; service-side data handling is a separate consideration.

![Image](https://cdn.agentkit.best/blog/cfai-media/9b99001ec81ca25cc8f8b93fad7f5a29d4a76b5f547a154a77ca6a6e87e8eca0-d8c1924a946404bd32d18f6710d6f18e45015646d2e296c7694d7ba2b21c2fbb.jpg)

## How to export the current Claude Code conversation

Use `/export` inside Claude Code to create a readable representation of the current conversation. The export is separate from the working session.

### Export a full conversation

Inside an active Claude Code session:

`/export
`

Confirm success by inspecting the output, not merely by seeing the command finish. Check the beginning, the latest exchanges, and any tool output needed for the handoff.

For instance, an API auth debugging transcript should cover the suspected root cause, proposed changes, test outcomes, and open questions. This serves as an example handoff scenario, not an actual customer result.

A conversation export is not a forensic record of every internal event. Inspect its coverage, and do not infer its actual format solely from a filename extension.

### Copy only a recent response

For a short handoff, selecting and copying the relevant response may be sufficient. That captures only the selected material, not the preceding discussion, supporting tool activity, or a resumable session record.

![Image](https://cdn.agentkit.best/blog/cfai-media/9df0c36e375808200f268beaea16b476b97b905bc9d1027eee2d80d8584cd1bb-6c64a01aff7a67fde9a46a1e114bff10da885e366cb7a4653609743adc6df3a5.jpg)

## How to resume a saved Claude Code conversation

Continue chooses recent work; resume lets you choose the conversation. Start in the original project location to reduce ambiguity.

### Resume the most recent session

Run this in your terminal:

`cd /path/to/project
claude --continue
`

Replace `/path/to/project` with your actual directory. This continues the most recent applicable session in that directory, not necessarily your latest conversation anywhere on the machine.

### Choose or switch to an earlier session

To choose a saved conversation from your terminal:

`claude --resume
`

To select another conversation from inside an active Claude Code session:

`/resume
`

Use the session picker to locate and select the intended conversation. Follow the controls shown in your installed version rather than relying on shortcuts from a different release.

A session missing from the initial list is not necessarily deleted. Check project scope and available filters before looking for raw files.

### Resume a specific named session

For a session previously named `saas-api-auth-debug`, run this in your terminal:

`claude --resume saas-api-auth-debug
`

Descriptive, distinct names reduce confusion when several debugging sessions begin with similar prompts. If the name is ambiguous, use the picker to confirm the right conversation.

When you resume a Claude Code session after exit, you recover conversational continuity—not a historical execution environment. Resuming does not roll back source files, reinstall dependencies, or recreate running services.

Before continuing authentication debugging, confirm the current branch, working-tree changes, and test environment.

![Image](https://cdn.agentkit.best/blog/cfai-media/5de9e3cfb0ce110640584cbf2ce7c7c66e939e2292b1591883be1c482b2d3df7-c15004a1cb8abd99959705cc393a8ac4029754f8ee16c1777388f971fa82e979.jpg)

## Where Claude Code stores conversation history

The default Claude Code transcript location is beneath the local Claude Code configuration directory. A schematic path is:

`~/.claude/projects/\<project-directory\>/\<session-id\>.jsonl
`

Here, `~` means the relevant user’s home directory. The project component represents an encoded directory identifier, not necessarily the literal repository name.

JSONL transcript files contain structured JSON records, one per line. They are machine-oriented records, not ordinary readable exports.

Custom configuration locations can change the base path. Containers, remote hosts, and WSL also have their own filesystem locations; inspect the environment where Claude Code actually ran.

### Why a saved session may not appear

Possible causes include a different directory or worktree, user, machine, runtime environment, interface, persistence mode, picker filter, or cleanup activity.

### Recovery checks

Copy raw records before manipulating them. Never edit the only original transcript to attempt session recovery. If every copy has been deleted, these checks cannot guarantee recovery.

![Image](https://cdn.agentkit.best/blog/cfai-media/c682864fc3fa2587192438bbd493ce287d6eaa0e3658987f56005e00e3aeb9f2-b904ae24c373b663801dae3373c9528f1f2d3e9156b4e1887d505ffdb28efa9d.jpg)

## Save vs. Export vs. Resume vs. Compact vs. Back up

Choose by preservation outcome, not just convenience. Session persistence, readable documentation, and independent archives solve different problems.

Inside a session, `/compact` summarizes context; it is not a full backup. Likewise, a readable export or individual JSONL file is not a guaranteed restoration package.

Use a consistent `project-feature-task` pattern:

Inside Claude Code:

`/rename saas-api-auth-debug
`

Naming improves discovery. It does not create another copy or change your retention policy.

## How to preserve and share important sessions safely

To back up Claude Code chat logs, separate the protected internal original from the sanitized sharing copy.

### Pre-sharing security checklist

If a credential was exposed, revoke or rotate it. Redacting the transcript alone does not resolve the exposure.

### Optional workflow standardization

Make session naming, export review, and handoff notes part of your existing engineering checklist. Native Claude Code methods are sufficient; no additional product is required.

![Image](https://cdn.agentkit.best/blog/cfai-media/57ff6dd39a2f792296d637da55e2231a110322f48ed9a01c84190378f783061e-64fc7e94efc8fb051f5f737942af615062a93ff001fc898675d620117527de5d.jpg)

## Frequently asked questions

### How does Claude Code save my conversation automatically?

Claude Code stores your conversation history continuously as you work. Claude Code records conversational exchanges, tool activity, and session metadata locally as you work. However, not all tool output is retained in full within the JSONL file within your local project directory at `~/.claude/projects/`. This ensures your progress persists even if you exit the CLI or clear the terminal.

### What is the difference between `claude --continue` and `claude --resume`?

`claude --continue` instantly reopens your most recent conversation in the current project directory. In contrast, `claude --resume` opens an interactive session picker, allowing you to browse, preview, and select from a list of your historical conversations based on timestamps or session names.

### Why might a previous session not appear in the session picker?

If a session is missing, verify that you are in the correct project directory or worktree. Claude Code filters history based on the project path. Additionally, ensure you are using the same environment or user account where the session was initially created, as sessions are stored locally within specific configuration directories.

### Does `/compact` delete my conversation history?

No. The `/compact` command is designed to manage your active context window by summarizing previous interactions, not to archive or delete them. Your full conversation remains in the local transcript file, subject to your retention and cleanup settings in the project's local JSONL transcript file, which can be referenced or resumed even after compaction occurs.

### How do I share a Claude Code conversation safely?

To share a session, export it to a file using `/export \<filename.md\>`. Before sharing, perform a security review to redact sensitive information such as API keys, internal network paths, proprietary code snippets, or customer data. Always share the resulting file through secure, approved organizational channels rather than public platforms.

**Read more**:

## Conclusion

Saving a Claude Code conversation starts with choosing the right outcome. Use `/export` for a readable transcript, `claude --continue` for recent work, and `claude --resume` when you need a particular saved session. Name important conversations so they remain easy to identify.

For longer-term preservation, keep independent copies under appropriate access and retention controls. Review every sharing copy for secrets, source code, and customer information. Remember that `/compact` is not a full backup, and resuming does not restore an earlier filesystem state. Adopt the preservation and security checklist above for your next engineering handoff.
