[BUG] Read tool fails to load images in VSCode extension but works in CLI
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 (
cccommand): 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:
- Successfully load the image file
- Return the visual content for AI model recognition
- 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:
- Use the CLI version: Run 'cc' command in terminal
- Paste the image directly into the chat window
```
Long-term (Proper Fix):
- Integrate image processing capabilities in the VSCode extension to match CLI functionality
- Implement proper error handling and logging for debugging
- Document any limitations in the official documentation
- 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
- Open VSCode with Claude Code extension (v2.1.129) installed
- 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
- Use Read tool in Claude Code chat:
``typescript``
Read({
file_path: "C:\\test_images\\test.png"
})
- Observe the result:
- Expected: Image content displayed for recognition
- Actual:
Tool ran without output or errors(empty)
- 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:
- Use Terminal CLI (
cccommand) instead of VSCode extension - Paste images directly into the chat window (this works in VSCode extension)
- 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
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗