1. Home
  2. Claude features
  3. Claude Code export

Export a Claude Code conversation as a transcript

Use the terminal’s export command for a readable transcript, then prepare a copy for your PR, teammate, or notes.

To export a Claude Code conversation, enter /export inside your terminal session. Copy the transcript or save a plain-text file. Add a filename to save directly. Keep the original, then prepare an edited copy if a teammate needs a shorter document.

Save the current terminal conversation

Enter /export to choose between clipboard and file output, or supply a filename to skip that choice:

/export pr-142-date-parser.txt

Type this at Claude Code’s prompt inside the conversation you want, not at your ordinary shell prompt.

  1. Open the intended Claude Code conversation.
  2. Enter /export.
  3. Choose the file option in the dialog.
  4. Save it with a name you’ll recognize later.
  5. Open the saved file in a text editor.

The session guide describes messages and tool outputs rendered as readable text. Look for the question that started the investigation, the answer you need, and the relevant command results.

Use a new filename after another round of debugging. A date or PR number helps distinguish copies, especially when the first export contains a proposed fix and the next records a changed approach.

Reopen an older session before exporting

Resuming returns you to a conversation so you can work in it. Exporting gives you a reading copy to keep or send. Choose the session first, then export it.

From the project directory in your shell, run:

claude --continue

This reopens that directory’s most recent conversation. To select another, use:

claude --resume

You can also give a session name or ID, such as claude --resume date-parser-fix. The CLI reference documents both options.

Check that you reopened the intended investigation: sessions about the same bug can contain different assumptions, patches, or test results. For a transcript, export the exchange itself rather than replacing it with a summary.

Find the saved history on disk

The default transcript location is:

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

By default, the project folder name comes from the working directory’s path. Each line is a JSON record. Anthropic describes this format as internal and subject to change between releases, so use the readable export for a handoff.

The transcript is stored under your home directory’s .claude folder, separate from a repository’s configuration folder. On Windows, that .claude folder is %USERPROFILE%\.claude. Setting CLAUDE_CONFIG_DIR changes the location, as explained in the directory guide.

Subagent transcripts and large tool results can live in separate files. Look for any essential result in the export and provide the needed file separately when appropriate. A copied JSONL file isn’t a complete project handoff.

Review the exact copy you’ll share

Read prompts and tool output as carefully as Claude’s answers. Anthropic’s plaintext-storage guidance says credentials read from a file or printed by a command can be written into the transcript.

Search for tokens, passwords, connection strings, private URLs, customer details, and pasted configuration. Read the surrounding text too: a search for “password” won’t catch a credential with an unfamiliar label.

Keep any required original with your team’s private records. Make a separate delivery copy with sensitive passages removed, and label redactions where they affect the discussion. Reopen the attachment before uploading it to confirm you selected that reviewed copy.

Prepare a Word or PDF document

The native export is plain text. Renaming its extension to .md doesn’t add Markdown headings, turn labels, or code fences.

Prepare a separate Markdown copy. Add a title, preserve who said what, and put command output and source code inside fenced code blocks. Use matching fences, and choose a longer fence if the pasted text already contains one. Label shortened material as an edited excerpt.

Once that copy contains the Markdown you want:

  1. Paste it into the free Markdown to Word converter or Markdown to PDF converter.
  2. Download the Word file, or save the PDF through the print dialog.
  3. Open the result and compare code, command output, and speaker labels with your prepared copy.

The converters run in your browser and format the text you supply. Keep the saved transcript beside the document when an edited copy leaves out context.

Example: give a reviewer the date-parser investigation

Suppose you investigated a parser that rejects February 29 in a leap year. Save the conversation as pr-142-date-parser.txt, then prepare a note explaining the rejected input, proposed change, and checks still needed.

For the PR note, put the reproduction input, expected behavior, observed behavior, proposed fix, and validation status under separate headings. This lets a reviewer see the current proposal without reading through each abandoned approach.

Include the exact input that reproduces the problem, such as 2024-02-29. Compare any code excerpt with the patch you’re proposing. Record a check as passed only after running it, and leave unresolved cases visible in the note.

Point the reviewer to the reviewed transcript for the longer discussion. The GitHub handoff guide covers placing that note beside the code and using an excerpt in a PR.

Keep Claude Code separate from claude.ai chat exports

Claude Code also runs in the desktop app and browser. The export and local-session steps above cover the CLI.

DocMyChat works with ordinary claude.ai chats in desktop Google Chrome. It doesn’t export Claude Code sessions, including Code sessions in the browser or desktop app. For an ordinary Claude chat, use the developer export workflow for its conversation and generated files.

Questions

Can I copy just Claude’s last answer?

Yes. The CLI’s /copy command copies the latest assistant response, while /copy 2 selects the second-to-last response. When the response contains code blocks or quotes, a picker lets you choose a block or the full answer.

Can I share a session link instead?

As of November 2026, cloud-session sharing offers Team visibility within Team and Enterprise organizations, with repository access verified by default. Pro, Max, and Ultra offer Public visibility to signed-in Claude users, without that verification by default. Review the session and sharing settings before sending its link.

Can I get JSON for a script?

For a non-interactive -p run, the CLI supports --output-format json and --output-format stream-json. These options format that run’s output. Use /export for a readable transcript of an existing conversation.