claude-code - 💡(How to fix) Fix /export produces 0-byte .txt files [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#48814Fetched 2026-04-16 06:50:13
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

The /export slash command creates the .txt file with the correct timestamped filename, but the file is 0 bytes — no content is written. This has been happening consistently for at least the last few days.

Root Cause

The /export slash command creates the .txt file with the correct timestamped filename, but the file is 0 bytes — no content is written. This has been happening consistently for at least the last few days.

Fix Action

Workaround

Session data is preserved in ~/.claude/projects/<project>/*.jsonl and can be converted to readable text manually by parsing the JSONL.

Code Example

$ wc -l 2026-04-15-*.txt
       0 2026-04-15-011219-bp_convo_cont_2.txt
       0 2026-04-15-011240_pipeline_setup_checklist.txt
       0 2026-04-15-110022-goog-trends-convo-pt3.txt
       0 2026-04-15-151458-signals-brainstorm-1.txt
       0 2026-04-15-181533-seo-research-2.txt
       0 2026-04-15-181648-local-command-caveatcaveat-the-messages-below.txt
RAW_BUFFERClick to expand / collapse

Description

The /export slash command creates the .txt file with the correct timestamped filename, but the file is 0 bytes — no content is written. This has been happening consistently for at least the last few days.

Steps to Reproduce

  1. Have an active conversation with tool use, messages, etc.
  2. Run /export
  3. File is created (e.g., 2026-04-15-181533-seo-research-2.txt) but is empty

Evidence

All 6 exports from April 15 are 0 bytes:

$ wc -l 2026-04-15-*.txt
       0 2026-04-15-011219-bp_convo_cont_2.txt
       0 2026-04-15-011240_pipeline_setup_checklist.txt
       0 2026-04-15-110022-goog-trends-convo-pt3.txt
       0 2026-04-15-151458-signals-brainstorm-1.txt
       0 2026-04-15-181533-seo-research-2.txt
       0 2026-04-15-181648-local-command-caveatcaveat-the-messages-below.txt

The underlying session data in ~/.claude/projects/<project>/<uuid>.jsonl is intact — the JSONL files are 1-3MB each. Only the /export text serialization is broken.

Environment

  • Claude Code version: 2.1.110
  • OS: macOS Darwin 23.5.0
  • Shell: bash
  • Python: 3.11.5

Workaround

Session data is preserved in ~/.claude/projects/<project>/*.jsonl and can be converted to readable text manually by parsing the JSONL.

extent analysis

TL;DR

The /export command is likely failing to write content to the generated .txt file due to an issue with the text serialization process, despite the session data being intact in the JSONL files.

Guidance

  • Verify that the JSONL files in ~/.claude/projects/<project>/<uuid>.jsonl contain the expected data by checking their size (1-3MB each) and contents using a JSONL parser or viewer.
  • Check the Claude Code version (2.1.110) for any known issues or bugs related to the /export command or text serialization.
  • Manually parse the JSONL files to readable text as a temporary workaround, as described in the issue's Workaround section.
  • Investigate the text serialization process in the Claude Code to identify potential issues, such as encoding problems or data formatting errors.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The issue seems to be specific to the /export command and text serialization, and not related to the underlying session data or JSONL files. The workaround provided in the issue can be used to manually convert the session data to readable text.

Recommendation

Apply the workaround by manually parsing the JSONL files to readable text, as the root cause of the issue is not yet identified and a fix is not available. This will allow users to access their session data in a readable format until the issue is resolved.

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