claude-code - 💡(How to fix) Fix [BUG] /export produces 0-byte file (v2.1.98, macOS) [1 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#46073Fetched 2026-04-11 06:29:41
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
3
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1subscribed ×1

Error Message

Error Messages/Logs

No error messages in stderr. Exit appears successful.

Fix Action

Fix / Workaround

  • Shell: zsh
  • macOS Darwin 25.3.0
  • The JSONL transcript file (~/.claude/projects/.../session-id.jsonl) is correctly written and non-empty, so the conversation data itself is being recorded — only the /export markdown conversion appears broken.
  • Workaround: manually copying the JSONL file with cp ~/.claude/projects/.../<session-id>.jsonl ./
  • Permission mode: bypassPermissions (but also tested in default mode — same result)

Code Example

$ ls -la session-log.md
  -rw-r--r--  1 jidohyun  staff  0  Apr 10 14:03 session-log.md

$ wc -l session-log.md
0 session-log.md

# The command itself reports success:
# "Conversation exported to: /Users/jidohyun/.../session-log.md"

# No error messages in stderr. Exit appears successful.
# The JSONL transcript at ~/.claude/projects/.../session-id.jsonl is intact and non-empty.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The /export command produces a 0-byte empty file. Running /export session-log.md or /export (with auto-generated filename) both create the file at the correct path, but the file contains no content.

The command output says "Conversation exported to: /path/to/file" suggesting success, but ls -la shows 0 bytes. This happens regardless of conversation length — tested with a session containing 60+ messages and tool calls.

What Should Happen?

/export should create a Markdown file containing the full conversation transcript (user messages, assistant responses, tool calls and results).

Error Messages/Logs

$ ls -la session-log.md
  -rw-r--r--  1 jidohyun  staff  0  Apr 10 14:03 session-log.md

$ wc -l session-log.md
0 session-log.md

# The command itself reports success:
# "Conversation exported to: /Users/jidohyun/.../session-log.md"

# No error messages in stderr. Exit appears successful.
# The JSONL transcript at ~/.claude/projects/.../session-id.jsonl is intact and non-empty.

Steps to Reproduce

  1. Start a Claude Code session with any conversation (e.g. claude "hello")
  2. Have at least a few exchanges so there's content to export
  3. Run /export session-log.md
  4. Check the output: ls -la session-log.md → shows 0 bytes
  5. Also tried /export without filename — auto-generated .txt file is also 0 bytes

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.98 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Shell: zsh
  • macOS Darwin 25.3.0
  • The JSONL transcript file (~/.claude/projects/.../session-id.jsonl) is correctly written and non-empty, so the conversation data itself is being recorded — only the /export markdown conversion appears broken.
  • Workaround: manually copying the JSONL file with cp ~/.claude/projects/.../<session-id>.jsonl ./
  • Permission mode: bypassPermissions (but also tested in default mode — same result)

extent analysis

TL;DR

The /export command may be failing to write conversation data to the Markdown file due to an issue with the export functionality.

Guidance

  • Verify that the conversation data is being recorded correctly by checking the JSONL transcript file (~/.claude/projects/.../session-id.jsonl) as the user has already done.
  • Check the Claude Code version (2.1.98) for any known issues or updates that may address the export problem.
  • Test the /export command with different file formats or names to see if the issue is specific to Markdown files.
  • Consider using the provided workaround of manually copying the JSONL file until a fix is found.

Example

No code snippet is provided as the issue does not imply a specific code-related fix.

Notes

The root cause of the issue is unclear, but it appears to be related to the /export command's functionality. The fact that the JSONL transcript file is correctly written suggests that the conversation data is being recorded, but the export to Markdown is failing.

Recommendation

Apply workaround: manually copy the JSONL file as a temporary solution until the root cause of the /export command issue is identified and fixed. This allows users to still access their conversation data while a more permanent fix is developed.

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