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

  1. Use the Write tool to create an HTML file (e.g., .claude/visual-preview.html)
  2. The file automatically opens in the Preview panel (right sidebar)
  3. Use the Edit tool to modify the file content (e.g., change a text label)
  4. Click the refresh button in the Preview panel URL bar
  5. Expected: Updated content is shown
  6. Actual: Old content persists, even after multiple refreshes

Workaround

  • The preview_eval tool with window.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) and http://localhost:8899/ (via preview_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).

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗