Bug: `--resume` session shows wrong image content when reading new files with unique paths

Resolved 💬 3 comments Opened Dec 24, 2025 by CameronImmesoete Closed Mar 1, 2026

Bug: --resume session shows wrong image content when reading new files with unique paths

Summary

When using --resume to continue a Claude Code session, Claude describes content from a previously read image instead of the newly specified image file, even when the new file has a completely different, unique path.

Environment

  • Claude Code version: 2.0.72
  • OS: macOS Darwin 25.1.0, arm64
  • Shell: zsh

Steps to Reproduce

1. Create test images and a working directory

# Create temp directory
mkdir -p /tmp/claude-resume-bug-test
cd /tmp/claude-resume-bug-test

# Download two distinctly different test images
curl -o image1.png "https://via.placeholder.com/100/FF0000/FFFFFF?text=RED"
curl -o image2.png "https://via.placeholder.com/100/0000FF/FFFFFF?text=BLUE"

2. Start a new Claude Code session and read the first image

echo "Please read and describe the image at /tmp/claude-resume-bug-test/image1.png" | claude --print --output-format stream-json

Expected: Claude describes a red image with "RED" text ✅

3. Note the session ID from the output

Look for the session_id in the JSON output:

{"type":"system","subtype":"init","session_id":"abc123..."}

4. Resume the session and ask about a DIFFERENT image with a UNIQUE path

# Copy image2 to a completely new unique filename
cp image2.png "$(uuidgen)_unique_image.png"

# Resume session and ask about the NEW unique file
echo "Please read and describe the image at /tmp/claude-resume-bug-test/$(ls *_unique_image.png)" | claude --print --output-format stream-json --resume abc123

Expected: Claude describes a blue image with "BLUE" text ❌
Actual: Claude describes the RED image from the first message

Expected Behavior

When given a new, unique file path that has never been seen before, Claude should read and describe that specific file:

The image shows a blue square with white text that says "BLUE"

Actual Behavior

Claude describes the previously read image instead of the new one:

The image shows a red square with white text that says "RED"

This happens even though:

  1. The file path is completely different
  2. The filename includes a UUID (never seen before)
  3. The file content is different

Additional Observations

  1. New sessions work correctly - Starting a fresh session (without --resume) correctly reads the new image
  2. Unique paths don't help - Even UUID-prefixed filenames that could not possibly be cached are misread

Impact

This bug breaks any workflow that:

  • Uses --resume to maintain conversation context
  • Needs Claude to read new files in an ongoing session

Workaround

Start a completely new session when needing to read new files (loses conversation context).

Related

This may be related to how --resume reconstructs the conversation history and caches tool results.

View original on GitHub ↗

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