How to export a Claude Code conversation?

To export a Claude Code conversation, type /export in the session; Claude Code opens a menu that copies the current conversation to your clipboard or saves it as a plain-text file.

As of December 2, 2026, the Claude Code documentation states:

  • Skip the menu: add a filename, such as /export session-notes.txt, to write straight to that file. On version 2.1.327 or later, the file must not already exist.
  • What you get: a rendered, readable transcript of the current conversation, not structured data.
  • Earlier sessions: reopen one with claude --continue or claude --resume, then run /export.
  • Raw history: every session is saved as JSONL at ~/.claude/projects/<project>/<session-id>.jsonl. Anthropic says the format is internal and changes between versions.
  • Retention: local transcripts are kept for 30 days by default; change this with cleanupPeriodDays in settings.json.
  • Scripts: claude -p --output-format json returns a run as JSON, and a SessionEnd hook can archive the transcript when a session ends.

Related: Claude Code 2.1.333 power-user guide, How to export Claude data? and How to search Claude chats?

Source: Claude Code Docs, “Manage sessions” (Export and locate session data); Claude Code Docs, “Commands” (/export)

Image: Claude logo by Anthropic, public domain (trademarked), via Wikimedia Commons. Placed on a white background and resized. Claude is a trademark of Anthropic. FreeAnswers is not affiliated with or endorsed by Anthropic.



Related answers

Leave a Comment