Skip to content

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

Description

@jawadka97

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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:
    • Create styles.css with basic styling:
      body { background-color: blue; color: white; font-size: 18px; }
      h1 { margin: 20px; }
  3. In Claude Desktop, click "Preview" on the index.html file

  4. Observe the preview panel opens with URL: file://index.html

  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions