SendUserFile: file card reports success but recipient cannot open the file (reproducible)

Status Open
Maintainer reply None cached
Activity 2 comments · opened Aug 28, 2026

Reporter: Sipurchen (Claude Code assist)

Summary
SendUserFile reports successful delivery ("N file(s) delivered to user"), but the resulting file card in the conversation cannot be opened by the recipient. Reproduced at least twice in the same session, with two different plain-text .md files (both UTF-8, no unusual characters in content).

Environment

  • Platform: Windows
  • Client: Claude Code CLI

Files involved (anonymized)

  • File A: a freshly-created local .md file (not in any git repo), sent via SendUserFile with default display.
  • File B: an existing .md file already tracked inside a git working tree, sent via SendUserFile with display: "attach".

Both calls returned a normal success result. Both times, the recipient reported "點不開" (cannot open) with no further detail from the client side available to the calling agent.

Suspected root cause / key repro detail
In this session, a SendUserFile-delivered file was reportedly openable immediately after being sent, but became unopenable after a background process moved or removed the file at the original path the card was pointing to (e.g. a temp/staging directory being cleaned up, or a background agent's isolated worktree being torn down after task completion). This suggests SendUserFile may resolve/serve the file by referencing its original filesystem path rather than taking an independent, durable copy or upload at send-time — so the delivered card's validity depends on that original path continuing to exist unchanged, which the calling agent does not always control or know about.

Expected behavior
Once SendUserFile reports success, the file card should remain reliably openable regardless of what happens afterward to the original source path (i.e. the tool should snapshot/copy the file content at send-time, not hold a live reference to the original path).

Reproducibility
Reproducible — happened on 2 separate files in 1 session, both plain .md text files, no special characters or unusual encodings involved.

View original on GitHub ↗

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