[BUG] /export produces 0-byte file (v2.1.98, macOS)
Status Fixed / completed
Reported on v2.1.98
Maintainer reply ✓ Yes — ashwin-ant
Workaround ✓ Mentioned in description ↑
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
- Start a Claude Code session with any conversation (e.g.
claude "hello") - Have at least a few exchanges so there's content to export
- Run
/export session-log.md - Check the output:
ls -la session-log.md→ shows 0 bytes - Also tried
/exportwithout 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
/exportmarkdown 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)
3 Comments
Still broken on Claude Code
v2.1.109on macOSThis 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.
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.