[BUG] Preview tool screenshot always returns black image after browser gets into broken state
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 preview tool's internal browser gets stuck and screenshots always return a completely black image. Even when the server is running and window.location.href shows the correct localhost URL, the screenshot capture is broken.
<img width="651" height="1120" alt="Image" src="https://github.com/user-attachments/assets/e4c5ca52-f77e-4814-912a-c21eef79abaf" />
What Should Happen?
Screenshots should show the actual rendered app.
Error Messages/Logs
chrome-error://chromewebdata/ — the internal browser gets stuck on this URL and cannot navigate to localhost.
Steps to Reproduce
Start a Vite dev server via preview_start
The internal browser fails to load localhost (stuck on chrome-error://chromewebdata/)
Navigate via preview_eval → location.href shows the correct URL
Call preview_screenshot → returns completely black image
Restarting Mac does not fix it within the same Claude Code session
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
4.6
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗