claude-code - 💡(How to fix) Fix [BUG] Read tool renders same image content across different cached image files [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47940Fetched 2026-04-15 06:38:00
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

Use direct file paths (/read /path/to/file.png) instead of [Image #N] references. Reading directly from the user's Screenshots folder (/Users/davidkim/Screenshots/) works correctly — the rendering bug appears isolated to the image cache mechanism.

Code Example

MD5 (1.png) = f04e9843ca84d39488740f12f192f62c  (182736 bytes)
MD5 (2.png) = 2e0d17c2e500f5d15a0148437b6a8a50  (95355 bytes)
MD5 (3.png) = 8584352e7ddeb4e529d5cfadf19c90da  (241190 bytes)
MD5 (4.png) = 1f3a6d5796454b1b9826b6f29e1730dd  (36971 bytes)
RAW_BUFFERClick to expand / collapse

Bug Description

The Read tool renders identical image content when reading different image files from the Claude Code image cache (~/.claude/image-cache/). Despite files on disk having different MD5 hashes and file sizes, the Read tool returns the same rendered content for all of them.

Environment

  • Claude Code version: (latest)
  • Platform: macOS (Darwin)
  • API: Anthropic API (user is using their own API key, not Claude Max subscription)
  • Terminal/Shell: zsh

Steps to Reproduce

  1. Paste image A into Claude Code chat → [Image #1] created at ~/.claude/image-cache/<session>/1.png
  2. Paste image B into Claude Code chat → [Image #2] created at ~/.claude/image-cache/<session>/2.png
  3. Paste image C into Claude Code chat → [Image #3] created at ~/.claude/image-cache/<session>/3.png
  4. Paste image D into Claude Code chat → [Image #4] created at ~/.claude/image-cache/<session>/4.png
  5. Ask Claude to describe each [Image #N]
  6. All [Image #N] references return the same rendered content — the first image pasted — despite each file having different MD5 hashes and sizes on disk.

Evidence

Session ID: d26cfe96-8eb9-4074-8b36-91dcdd6167ae

File hashes confirm files are genuinely different:

MD5 (1.png) = f04e9843ca84d39488740f12f192f62c  (182736 bytes)
MD5 (2.png) = 2e0d17c2e500f5d15a0148437b6a8a50  (95355 bytes)
MD5 (3.png) = 8584352e7ddeb4e529d5cfadf19c90da  (241190 bytes)
MD5 (4.png) = 1f3a6d5796454b1b9826b6f29e1730dd  (36971 bytes)

Yet Read tool returns identical conversation screenshot content when reading any of these files. The image cache path is: ~/.claude/image-cache/d26cfe96-8eb9-4074-8b36-91dcdd6167ae/

Additional Observations

  • The image URL in the chat message references minimax-algeng-chat-tts-us.oss-us-east-1.aliyuncs.com — but this is the user's own API infrastructure, NOT a Claude Code issue
  • The user is on their own API key, which means image caching behavior may differ from the Claude Max subscription flow
  • The session is using Opus 4.6 (claude-opus-4-6)

Root Cause Hypothesis

The Read tool's image rendering layer appears to resolve multiple distinct image cache files to the same rendered content. Possibilities:

  1. A session-level image index that maps [Image #N] references to a single canonical rendered image
  2. The rendering service collapsing all cache reads to the first image loaded in the session
  3. Some session state that overrides fresh image reads with a cached render of the initial image

Impact

  • Claude cannot reliably analyze multiple distinct images pasted in the same session
  • Each [Image #N] reference resolves to the first image instead of the intended one
  • This affects any workflow requiring comparison of or reference to multiple screenshots

Workaround

Use direct file paths (/read /path/to/file.png) instead of [Image #N] references. Reading directly from the user's Screenshots folder (/Users/davidkim/Screenshots/) works correctly — the rendering bug appears isolated to the image cache mechanism.

extent analysis

TL;DR

The most likely fix is to use direct file paths instead of [Image #N] references to bypass the image cache mechanism.

Guidance

  • Verify that the issue is indeed related to the image cache by comparing the results of using direct file paths versus [Image #N] references.
  • Check the session-level image index or rendering service configuration to see if there are any settings that could be causing the issue.
  • Try clearing the image cache or restarting the session to see if the issue persists.
  • Consider using a different image caching mechanism or updating the rendering service to resolve the issue.

Example

No code snippet is provided as the issue seems to be related to the image cache mechanism and not a specific code implementation.

Notes

The issue may be specific to the user's own API infrastructure and image caching behavior, which could differ from the Claude Max subscription flow. The workaround provided in the issue description may not be a permanent solution and further investigation is needed to resolve the root cause.

Recommendation

Apply the workaround by using direct file paths instead of [Image #N] references, as it has been shown to work correctly in the user's environment. This will allow the user to continue working with multiple images in the same session while a more permanent solution is investigated.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Read tool renders same image content across different cached image files [1 comments, 2 participants]