[BUG] mishandles absolute paths (prepends CWD to absolute destination)
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?
When using claude (Claude Code CLI) to export a conversation to an absolute path, the command incorrectly prefixes the current working directory (CWD) to the absolute path. This results in a combined, invalid path and an ENOENT error.
Full session excerpt:
om777:~/Documents/sippy$ claude
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code! │
│ │
│ /help for help, /status for your current setup │
│ │
│ cwd: /home/om777/Documents/project │
╰───────────────────────────────────────────────────╯
> Hello
● Hello! I'm Claude Code, ready to help you with your software engineering tasks. What would you like to work on today?
> /export /home/om777/Documents/qwerty.txt
⎿ Failed to export conversation: ENOENT: no such file or directory, open '/home/om777/Documents/project/home/om777/Documents/qwerty.txt'
What Should Happen?
If the destination begins with / (absolute path), it should be used as-is and not joined with the CWD. The file /home/om777/Documents/qwerty.txt should be created (with parent directories respected/created if needed).
Error Messages/Logs
Failed to export conversation: ENOENT: no such file or directory, open '/home/om777/Documents/project/home/om777/Documents/qwerty.txt'
Steps to Reproduce
STR:
- Open the Claude Code TUI in a directory, e.g. /home/om777/Documents/project
- Start a conversation and then run:
/export /home/om777/Documents/qwerty.txt
Actual result:
Claude attempts to write to a path that incorrectly combines the CWD with the absolute path:
Failed to export conversation: ENOENT: no such file or directory, open '/home/om777/Documents/project/home/om777/Documents/qwerty.txt'
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
1.0.123
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗