[BUG] /export produces 0-byte file (v2.1.98, macOS)

Status Fixed / completed
Reported on v2.1.98
Maintainer reply ✓ Yes — ashwin-ant
Activity 3 comments · opened Apr 10, 2026 · closed Apr 19, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] 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)

View original on GitHub ↗

3 Comments

solrevdev · 4 months ago

Still broken on Claude Code v2.1.109 on macOS

ashwin-ant collaborator · 4 months ago

This has been fixed in a recent release — /export no longer produces 0-byte files. The fix will land in v2.1.115+. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.