[BUG] Claude Desktop Preview For Static HTML Pages Opens file:// Instead of Live Server — CSS Styles Not Loading

Resolved 💬 1 comment Opened Jun 26, 2026 by jawadka97 Closed Jul 10, 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?

Claude Desktop automatically starts a Preview for HTML projects but then opens the preview using file://index.html protocol instead of pointing to the running HTTP server (http://localhost:PORT). This causes CSS stylesheets to fail loading silently, resulting in completely unstyled HTML rendering.

When I click "Preview" on an HTML file with external CSS stylesheets:

  • Preview opens with URL: file://index.html
  • CSS stylesheets fail to load completely
  • Page renders completely unstyled (no colors, fonts, layouts, spacing)
  • Images don't load
  • No error messages shown

Same page renders perfectly in Chrome on http://localhost:PORT or via fille://{fullpath}

What Should Happen?

Claude Desktop should open the preview to the live server it started (http://localhost:PORT), not file://.
also no issues if it opens it with fille://{fullpath} if that will show the correct page with styles

Steps:

  1. Claude Desktop starts live server on http://localhost:XXXX
  2. Preview opens to http://localhost:XXXX (or http://localhost:XXXX/index.html)
  3. All CSS, images, and JavaScript load correctly
  4. Page renders exactly as it appears in Chrome on localhost

This is a routing issue—the server plumbing exists, but the wrong endpoint is being used.

Error Messages/Logs

None

Steps to Reproduce

  1. Open Claude Desktop
  2. Create or open an HTML project with external CSS files:
  • Create index.html with a link to an external stylesheet:

<link rel="stylesheet" href="./styles.css">

  • Create styles.css with basic styling:

body { background-color: blue; color: white; font-size: 18px; }
h1 { margin: 20px; }

  1. In Claude Desktop, click "Preview" on the index.html file
  2. Observe the preview panel opens with URL: file://index.html
  3. Notice: CSS is NOT applied—page shows unstyled plain HTML
  • No background color
  • No custom fonts or colors
  • No spacing or layout styling
  • Just raw browser defaults

Expected: Preview should open to http://localhost:PORT and CSS should load correctly
Actual: Preview opens to file:// protocol and CSS fails silently

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.15962.0 (039543)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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