[FEATURE] Preview should allow localhost subdomains (e.g. playground.localhost)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When using the Preview feature, navigating to a localhost subdomain like playground.localhost:3000 is blocked with the message:
Link to playground.localhost was blocked. Preview only supports localhost URLs.
Localhost subdomains resolve to 127.0.0.1 the same as localhost and are commonly used in local development (e.g. multi-tenant apps that route by subdomain). The preview URL allowlist should permit *.localhost in addition to localhost.
<img width="549" height="93" alt="Image" src="https://github.com/user-attachments/assets/45cf473d-62e4-4c11-9206-846a943bb106" />
Proposed Solution
The Preview URL allowlist should permit *.localhost in addition to localhost. All subdomains of localhost (e.g. playground.localhost, app.localhost) resolve to 127.0.0.1 per RFC 6761 and are safe to allow. No configuration should be needed — this should just work out of the box.
Alternative Solutions
Currently there's no workaround within Preview. The only option is to open the URL manually in a separate browser, which defeats the purpose of the integrated preview.
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
- I'm building a multi-tenant SaaS app (Tightknit) where each community is accessed via a localhost subdomain in local dev (e.g. playground.localhost:3000)
- I set up .claude/launch.json and start the dev server via Preview
- The app loads at localhost:3000 then redirects to playground.localhost:3000
- Preview blocks the redirect with "Link to playground.localhost was blocked"
- I have to copy the URL and open it in a separate browser, losing the integrated preview workflow
Additional Context
Localhost subdomains are guaranteed to resolve to loopback by RFC 6761 and are widely used by frameworks like Next.js, Vite, and Rails for multi-tenant local development. Most browsers and dev tools treat them identically to localhost.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗