claude-code - 💡(How to fix) Fix Feature request: Native session export to Markdown (/export command)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

This is not a reasonable ask for most users. The workaround is invisible by default and requires technical knowledge to discover.

Code Example

/export ~/exports/session-2026-05-30.md
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Claude Code stores every conversation as a JSONL file on disk (.claude/projects/<project>/<session-id>.jsonl). The full verbatim conversation is preserved there — but there is no native way to export it into a human-readable format.

The only way to recover a past session is to:

  1. Know the JSONL file exists
  2. Know where it lives on disk
  3. Write your own parser to extract human/assistant turns from it

Most users never discover this. The conversation is effectively trapped in a machine-readable format with no exit.

Why this matters: Claude Code compresses long sessions automatically and irreversibly. Once compression happens, emotional context, reasoning texture, nuanced decisions, and qualitative discussion are reduced to bullet points in a summary. The JSONL file is the only thing that preserves the original conversation — but it is inaccessible without custom tooling.

Use cases where this matters:

  • Long research or analysis sessions where the reasoning chain is as valuable as the conclusion
  • Career, strategy, or planning discussions with personal context that shouldn't be re-explained every session
  • Sessions that inform documentation, decisions, or code — where the "why" needs to be auditable later
  • Treating a conversation as a citable document or personal knowledge artifact

Proposed Solution

A native /export slash command that writes the current session to a Markdown file:

/export ~/exports/session-2026-05-30.md

Output format: clean ## You / ## Claude turns, plain text only — no tool use blocks, no thinking blocks, no terminal rendering artifacts. Just the substance of the conversation.

The exported Markdown should be:

  • Human-readable without any tooling
  • Suitable for archiving, sharing, or pasting into a future session as context
  • Filterable (e.g., --include-tools flag for users who want unfiltered output)

Optionally: a --session <uuid> flag to export a past session by ID, not just the current one.

The JSONL schema already contains everything needed. This is a parsing and surfacing problem, not a data problem.

Alternative Solutions

I wrote a Python script to parse the JSONL manually: it extracts user/assistant text turns, strips tool use blocks, thinking blocks, and terminal rendering artifacts, and outputs clean Markdown. It works but requires:

  • Knowing the JSONL file exists and where it is
  • Running a custom script manually
  • Discovering the session UUID from the filesystem

This is not a reasonable ask for most users. The workaround is invisible by default and requires technical knowledge to discover.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. I run a long session with Claude Code — deep technical analysis, gap identification, strategic decisions, and personal context about how the project fits into my workflow.
  2. The session runs long. Claude Code compresses it automatically. The compression produces a bullet-point summary that loses the reasoning texture, the nuance, and the personal context.
  3. The full conversation still exists verbatim in a JSONL file on disk — but I don't know where it is, and there's no native way to get it out.
  4. With /export ~/session-2026-05-30.md, I could save the conversation at any point during the session, before compression hits, and have a permanent human-readable record I can reference, share, or paste back as context in a future session.

This is particularly valuable for:

  • Multi-hour analysis sessions where the chain of reasoning matters
  • Sessions that mix technical work with planning and context that shouldn't need to be re-explained
  • Treating Claude conversations as a second brain / knowledge artifact rather than a disposable chat

Additional Context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature request: Native session export to Markdown (/export command)