Skip to content

[BUG] /export overwrites existing files without warning #37595

@philipp-riedele

Description

@philipp-riedele

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information

Bug Description

The /export command silently overwrites existing files when the same filename is used. No warning, no confirmation, no prompt. Data is lost permanently.

Steps to Reproduce

  1. Run /export myfile — creates myfile.txt
  2. Continue conversation
  3. Run /export myfile again — silently overwrites the previous export

Expected Behavior

At minimum ONE of:

  • Warning: "File already exists. Overwrite? (y/n)"
  • Auto-increment: myfile_2.txt, myfile_3.txt
  • Error: "File already exists, use a different name"

Actual Behavior

File is silently overwritten. Previous export is permanently lost. No warning, no confirmation.

Proof

Verified with md5sum before and after: hash changed, file size changed, new content confirmed present in overwritten file.

Impact

High — users who name exports consistently (e.g., session1, session2) risk losing previous exports if they accidentally reuse a name. In long sessions with multiple exports this is especially dangerous.

Environment

  • Claude Code v2.1.76
  • Linux Mint
  • Opus 4.6

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibugSomething isn't workingplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions