[BUG] Clicking file links in Read tool call results doesn't open binary files (e.g. PNG) in VSCode

Resolved 💬 4 comments Opened Mar 23, 2026 by wwilson-andesite Closed Jul 7, 2026

What's Wrong?

In the Claude Code VSCode extension, clicking a file link in a Read tool call result does nothing for binary files like PNGs. Clicking the same style of link for a text file (e.g. .md, .ts) opens it correctly in the VSCode editor.

What Should Happen?

Clicking a .png file link in a Read tool call result should open the file in VSCode's built-in image preview, the same way clicking a .md link opens it in the text editor.

Error Messages/Logs

No error is shown — the click silently does nothing.

Steps to Reproduce

  1. In the VSCode extension, ask Claude to take a Playwright screenshot and save it to .playwright-mcp/screenshot.png
  2. Ask Claude to Read the PNG file — it renders inline in the chat correctly
  3. In the tool call result in the sidebar, click the screenshot.png file link
  4. Nothing happens — file is not opened in VSCode

Contrast: In the same conversation, click the link from a Read call on a .md file → VSCode opens it immediately.

Hypothesis: The extension likely routes link clicks through vscode.workspace.openTextDocument() which silently fails for binary files. Image files should go through vscode.commands.executeCommand('vscode.open', uri) to use VSCode's built-in image preview.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Claude Code Version

2.1.50 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

The file definitely exists on disk at the path shown — Claude reads and renders it inline successfully. The issue is specifically with the VSCode extension's link click handler not routing binary files to the image preview.

View original on GitHub ↗

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