[BUG] Read tool overwrites original image on disk

Open 💬 1 comment Opened Jul 15, 2026 by valentabc

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The Read tool destructively overwrites the user's original image file on disk when reading it.

When Claude reads an image file whose resolution exceeds the internal image‑sanitizer threshold, the sanitizer downscales the image to ~1200px on the long edge and writes the downscaled result back over the original source file, permanently reducing its resolution. The Read tool is documented as read‑only, so this is silent, unexpected data loss of the user's files.

Observed: I asked Claude Code to read four PNG renders (design visualizations) to look at them. All four originals were silently replaced on disk with 1200px‑wide downscaled versions. Files in the same folder that were NOT read kept their original resolution.

What Should Happen?

Read must never modify the file it reads. Any downscaling/sanitization for the model's context window must operate on an in‑memory or temporary copy only — the source file on disk must remain byte‑for‑byte unchanged (unchanged size, dimensions, and mtime).

Error Messages/Logs

Steps to Reproduce

  1. Put a high‑resolution PNG on disk, e.g. 3840×2160. Record its dimensions and mtime:

sips -g pixelWidth -g pixelHeight bigimage.png && stat -f '%Sm' bigimage.png

  1. In Claude Code, have it Read that image file (e.g. ask "look at bigimage.png").
  2. Re‑check the same file on disk:

sips -g pixelWidth -g pixelHeight bigimage.png && stat -f '%Sm' bigimage.png

Expected: dimensions and mtime unchanged.
Actual: the file is now ~1200px on its long edge and its mtime equals the moment Claude read it — the original was overwritten in place.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.209

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗