[BUG] Read tool fails to load images in VSCode extension but works in CLI

Resolved 💬 1 comment Opened May 6, 2026 by j20202301206-lang Closed Jun 3, 2026

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 completely fails to load image files in the VSCode extension environment. When attempting to read any PNG image file, the tool silently returns empty results with the message Tool ran without output or errors, providing no visual content or error information.

Key observations:

  • Terminal CLI (cc command): Read tool works correctly, successfully recognizes and returns image content
  • VSCode Extension (v2.1.129): Read tool returns empty, no content, no error message
  • 📊 Failure rate: 100% (tested 59 PNG files, all failed)

Environment:

  • OS: Windows 11 Pro (Build 10.0.22631)
  • Editor: Visual Studio Code 1.114.0 (user setup)
  • Commit: e7fb5e96c0730b9deb70b33781f98e2f35975036
  • Electron: 39.8.3
  • Node.js: 22.22.1
  • Claude Code Extension Version: 2.1.129

Comprehensive testing ruled out:

  • ❌ File size issue (tested files from small to 375KB - all failed)
  • ❌ Path encoding issue (tested both Chinese and English paths - both failed)
  • ❌ File corruption (verified PNG file headers, all valid)
  • ❌ Specific file issue (tested 59 different files - all failed)

This appears to be a systematic issue specific to the VSCode extension environment.

---

What Should Happen?

Expected Behavior

According to the Read tool documentation:

"This tool allows Claude Code to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually"

The Read tool should:

  1. Successfully load the image file
  2. Return the visual content for AI model recognition
  3. Behave consistently across both CLI and VSCode extension environments

Suggested Fixes

Short-term (Immediate):

  • Add a clear error message when image reading fails in VSCode extension:

```
Error: Image reading is not currently supported in the VSCode extension.

Workarounds:

  1. Use the CLI version: Run 'cc' command in terminal
  2. Paste the image directly into the chat window

```

Long-term (Proper Fix):

  1. Integrate image processing capabilities in the VSCode extension to match CLI functionality
  2. Implement proper error handling and logging for debugging
  3. Document any limitations in the official documentation
  4. Investigate and fix the root cause:
  • Missing image processing pipeline in VSCode extension
  • IPC data transfer issues
  • Sandbox restrictions preventing library loading

---

Error Messages/Logs

Steps to Reproduce

Minimal Reproduction

  1. Open VSCode with Claude Code extension (v2.1.129) installed
  1. Prepare a test image:

``powershell
# Create test directory and copy any PNG image
New-Item -ItemType Directory -Path "C:\test_images" -Force
# Place any valid PNG image as C:\test_images\test.png
``

  1. Use Read tool in Claude Code chat:

``typescript
Read({
file_path: "C:\\test_images\\test.png"
})
``

  1. Observe the result:
  • Expected: Image content displayed for recognition
  • Actual: Tool ran without output or errors (empty)
  1. Compare with CLI:

``bash
# Open terminal and run
cc
# Then use Read tool with same file path
# Result: ✅ Image content successfully recognized
``

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.129

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Detailed Test Cases

Test Case 1: Chinese Path

Read({
  file_path: "D:\\07问答工具链平台\\实践材料\\CC&i讯飞打通\\_extracted_images\\image1.png"
})
// Result: Tool ran without output or errors ❌

Test Case 2: English Path

Read({
  file_path: "C:\\test_images\\test.png"
})
// Result: Tool ran without output or errors ❌

Test Case 3: Multiple Files

  • Tested 59 PNG files (image1.png through image59.png)
  • File sizes ranging from small to 375KB
  • All files: Valid PNG format (verified file header: 89-50-4E-47-0D-0A-1A-0A)
  • Result: 100% failure rate in VSCode extension ❌

Test Case 4: CLI Comparison

# Same files tested in terminal CLI
cc
# Use Read tool with same file paths
# Result: ✅ All files successfully recognized

Test Results Summary

| Environment | Tool Version | Test Files | Success Rate | Notes |
|------------|--------------|------------|--------------|-------|
| VSCode Extension | 2.1.129 | 59 PNG files | 0% (0/59) | Silent failure, no error |
| Terminal CLI | Latest | 59 PNG files | 100% (59/59) | Works correctly |

---

📸 Additional Context

File validation:

# Verified PNG file header
Get-Content "C:\test_images\test.png" -Encoding Byte -TotalCount 8
# Output: 89-50-4E-47-0D-0A-1A-0A ✅ Valid PNG signature

Current workarounds:

  1. Use Terminal CLI (cc command) instead of VSCode extension
  2. Paste images directly into the chat window (this works in VSCode extension)
  3. Use Playwright approach (HTTP server + browser screenshot)

Impact:

  • Affects all users trying to use Read tool for images in VSCode extension
  • Causes confusion due to silent failure
  • Forces users to switch to CLI or use workarounds
  • Inconsistent behavior between CLI and VSCode extension

---

Related documentation:

  • Read tool documentation states image support should work
  • No mention of VSCode extension limitations in official docs

View original on GitHub ↗

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