Repository navigation
Description
Problem
When a user attaches an image (or other file) via Claude Code's UI ("ファイルを追加 / Attach file"), the assistant can perceive the image visually (multimodal vision), but has no programmatic access to the file's bytes or its original path on the user's filesystem.
This breaks any workflow where the assistant needs to forward the file to another system (upload to a remote server via scp, copy to a project directory, decode and process the bytes, hand to a CLI like wp media import). The assistant can describe the image perfectly but cannot pass it through.
Current workaround (unreliable)
The only path I found is to GUESS where the attached file might be on disk:
- Search
%TEMP%for recently-modified.tmpfiles - Heuristically match by mtime / file type / dimensions
This fails frequently because:
%TEMP%is a shared dumping ground. Edge, Chrome, OneDrive, Discord, screenshot tools, OS update caches, image generators (e.g. Gemini desktop app) all write.tmpfiles there at similar timestamps.- Filenames are random UUIDs (
4cc3b574-ce8f-4562-b751-ec2235791a77.tmp), indistinguishable from other apps' caches. - Claude Code's IndexedDB blob store (
%APPDATA%\Claude\IndexedDB\https_claude.ai_0.indexeddb.blob\1\<n>\<m>) does contain the attached image (correct size match), but it's wrapped in some Chromium-internal encoding — no\x89PNGsignature is present, so a naive byte search fails. Without an official decoder this isn't usable from a tool call. - Claude Code session JSON (
%APPDATA%\Claude\claude-code-sessions\...\local_*.json) does NOT contain the attached image base64 (verified empirically — files are small, no embedded large blobs).
So in practice, the assistant ends up uploading wrong files (a screensaver photo from another app's cache, a 128px favicon, or a webpage screenshot from Edge), then the user has to point out it's wrong, and the cycle repeats.
Repro
- User attaches a PNG via the UI's "ファイルを追加 / Attach file" button.
- User: "このアイキャッチをサーバーにアップロードして / Upload this thumbnail to my server."
- Assistant has the image in its multimodal context (can describe contents perfectly) but no way to
scpthe actual bytes — there is no file path it can point at. - Assistant searches
%TEMP%, picks a wrong file, uploads it. - User: "違う画像が貼られている / Wrong image is up."
Expected behavior
Any one of these would close the gap:
(a) New assistant tool — read_attachment(message_index, attachment_index, output_path)
Writes the bytes of the Nth attachment from the message at that index to a path the assistant chose. Most flexible.
(b) Auto-save attachments to a known, stable directory
e.g. ~/.claude/attachments/<session-id>/<message-index>-<attachment-index>.<ext>. Assistant can read with the existing Read tool by following a documented convention.
(c) Expose original source path via system message
When the attachment was added via file picker (not paste), include something like:
<attachment index=1 path="C:\Users\foo\Desktop\thumb.png" mime="image/png" />
Less private (path may leak details) but easiest to implement and most useful.
Why this matters
What should be a 1-step task — "upload the attached image to my WordPress site" — becomes a multi-turn debug session of find %TEMP% -mmin -10 ..., visual matching of candidates, repeated wrong uploads, and user frustration:
「ファイル、または写真を追加 から PNG ファイルをわたしているのに受け取れないとはどういう意味だ?」
That's a fair question, and the current architecture doesn't have a satisfying answer for it. The user's mental model — "I attached a file, the assistant has it" — is reasonable. The implementation reality (visual encoder consumes the bytes; no tool exposes them; assistant has to play hide-and-seek with the user's filesystem) is an un-userfriendly leak of internals.
Environment
- OS: Windows 11
- Claude Code (desktop app)
- Use case: filing assistant uploads user-attached images to remote WordPress / VPS via SSH and
wp media import
Related (but not duplicates)
- [FEATURE] Render images returned from MCP tool calls inline in chat UI #53980 — Render MCP-tool-returned images inline (about tool OUTPUT, not user INPUT — opposite direction)
- [DOCS] Image input docs missing token-budget/compression details for pasted and attached images #45477 — Image input docs missing compression details (docs only)
- Accumulated inline image base64 in session history causes 'Request too large (max 20MB)' — blocks all messages including /feedback #43056 — Accumulated inline base64 causes 20MB request limit (about size, not access)
Activity
github-actions commentedon Apr 27, 2026
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
github-actions commentedon May 1, 2026
This issue has been automatically closed as a duplicate of #16592.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
github-actions commentedon Jun 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.