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

Resolved 💬 3 comments Opened Apr 10, 2026 by jidohyun Closed Apr 19, 2026

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 ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗