[Bug] /export command broken on Windows: path handling and mkdir recursion failures
Bug Description
Bug: /export broken on Windows — path argument mishandled, default mode fails on CWD
Version:
Diagnostics
├ Currently running: native (2.1.117)
├ Commit: 5e9d59ce46d5
├ Platform: win32-x64
├ Path: C:\Users\mecav\.local\bin\claude.exe
├ Config install method: native
└ Search: OK (bundled)
Updates
├ Auto-updates: enabled
├ Auto-update channel: latest
├ Stable version: 2.1.104
└ Latest version: 2.1.117(run /doctor and paste your version here)
OS: Windows 11 Pro (10.0.26200)
Shell: bash on Windows
Started: ~1 week ago. Previously worked fine.
Symptom 1 — /export with no argument
/export
→ Failed to export conversation: EEXIST: file already exists,
mkdir 'D:\MEC\OneDrive\Documents\AI\Claude AI\Claude Code Projects'
The path in the error is my current working directory. /export is trying to mkdir the CWD itself (which of course exists). Looks like a missing {
recursive: true } on the fs.mkdir call, or the output path is being resolved to the CWD instead of a subfolder.
Symptom 2 — /export with a filename argument
/export travel-time-agent-debug-2
→ (same EEXIST error on CWD)
Symptom 3 — /export with an absolute path argument
/export "D:\MEC\OneDrive\Documents\AI\Claude AI\Claude Code Projects\Google Travel Time Agent\travel-time-agent-debug-2"
→ Failed to export conversation: ENOENT: no such file or directory,
mkdir 'D:\MEC\OneDrive\Documents\AI\Claude AI\Claude Code Projects\"D:\MEC\OneDrive\Documents\AI\Claude AI\Claude Code Projects\Google Travel Time
Agent'
Two bugs visible in this error:
1. Absolute paths are treated as relative. The argument is being path.join'd onto the CWD instead of detected as absolute. You can see the CWD prefix
followed by the full absolute path I provided.
2. Surrounding double-quotes are not stripped from the argument. Note the literal \"D:\ in the mkdir target — the opening quote character is being
included in the path.
Both also reproduce with a non-OneDrive absolute path (C:\Users\mecav\Documents\...) — same concatenation behavior.
Reproduction
1. Open any directory on Windows in Claude Code (OneDrive or non-OneDrive, path with or without spaces — all affected).
2. Try /export, /export name, and /export "C:\any\absolute\path\name".
3. All three fail with EEXIST or ENOENT as above.
Impact
/export is unusable on Windows. No workaround found (tried filename-only, absolute paths inside OneDrive, absolute paths outside OneDrive, and no-arg).
Suggested fix areas
- Use fs.mkdir(dir, { recursive: true }) or check fs.existsSync before creating.
- When argument is provided, detect absolute paths (path.isAbsolute) and skip the CWD join.
- Strip surrounding quote characters from the argument before path resolution.
---
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 2.1.117
- Feedback ID: 3d9f61d2-f825-4abf-9aca-74a8840ffdc4
Errors
[{"error":"Error: ENOENT: no such file or directory, unlink 'C:\\Users\\mecav\\AppData\\Local\\Temp\\claude\\D--MEC-OneDrive-Documents-AI-Claude-AI-Claude-Code-Projects\\61a57656-002a-4b67-813a-99760ff99f5e\\tasks\\a5d32470d4adba3f2.output'\n at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:7985:299)","timestamp":"2026-04-22T22:35:58.190Z"}]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗