Preview panel caches stale file content after Write tool updates
Resolved 💬 3 comments Opened Mar 29, 2026 by rbelgibayev Closed May 14, 2026
Description
When a file is created via the Write tool and automatically opened in the Preview panel (right sidebar in Claude Code desktop app), subsequent updates to the same file via Write or Edit tools are not reflected in the Preview panel — even after multiple manual refreshes (clicking the reload button in the Preview URL bar).
Steps to Reproduce
- Use the
Writetool to create an HTML file (e.g.,.claude/visual-preview.html) - The file automatically opens in the Preview panel (right sidebar)
- Use the
Edittool to modify the file content (e.g., change a text label) - Click the refresh button in the Preview panel URL bar
- Expected: Updated content is shown
- Actual: Old content persists, even after multiple refreshes
Workaround
- The
preview_evaltool withwindow.location.reload(true)on the Preview MCP server does show updated content - But the user-facing Preview panel (which loads the file via
file://protocol) does not update - Opening the file via
http://localhost:PORT/in a regular browser and doing Cmd+Shift+R works fine
Environment
- Claude Code desktop app (macOS)
- File served via both
file://(auto-opened by Write tool) andhttp://localhost:8899/(viapreview_start) - The Preview MCP server shows the correct updated content, but the Preview panel sidebar does not
Impact
Users see stale content in the Preview panel, leading to confusion about whether code changes were actually applied. This is particularly impactful for iterative visual development workflows (e.g., geometry diagram authoring with JSXGraph).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗