[BUG] Clicking file links in Read tool call results doesn't open binary files (e.g. PNG) in VSCode
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
- In the VSCode extension, ask Claude to take a Playwright screenshot and save it to
.playwright-mcp/screenshot.png - Ask Claude to
Readthe PNG file — it renders inline in the chat correctly - In the tool call result in the sidebar, click the
screenshot.pngfile link - 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.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗