[BUG] "Start dev server" button navigates to localhost:<port> instead of configured launch.json url (preview_start with {name} honors it correctly)

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Aug 9, 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?

The Browser pane's "start dev server" button ignores the url field in .claude/launch.json and navigates the tab to http://localhost:<port> instead — even though the same config, invoked directly via the preview_start tool with { name }, correctly navigates to the configured url.

This matters for any dev server that isn't reachable at plain localhost:<port> — in my case a DDEV-managed Craft CMS site reachable only via a custom HTTPS hostname on the DDEV router (https://mylocal.ddev.site), with the dev server's port (3000) used only for Vite's internal HMR websocket, not for browsing.

Environment

  • macOS
  • Claude Code (desktop app)
  • Project uses DDEV (Docker-based local dev environment) fronting a Vite dev server; the app is only reachable via DDEV's router at a custom https://.ddev.site hostname, not via localhost:<port>.

What Should Happen?

Both trigger paths should produce the same navigation result for the same launch.json entry: the tab should land on the configured url, not the raw localhost:<port> fallback.

Error Messages/Logs

Steps to Reproduce

  1. Fully stop any local dev environment (cold start — nothing running on the target port beforehand).
  2. In .claude/launch.json, add a configuration with an explicit url that differs from http://localhost:<port>:
{
  "version": "0.0.1",
  "configurations": [
    {
      "name": "site",
      "runtimeExecutable": "ddev",
      "runtimeArgs": ["npm", "run", "serve"],
      "port": 3000,
      "autoPort": false,
      "url": "https://mylocal.ddev.site"
    }
  ]
}
  1. Call the tool directly: preview_start({ name: "site" }). Result: navigates correctly to https://mod-lab-craft.ddev.site/. Tool result includes "configUrl": { "url": "https://mylocal.ddev.site/", "outcome": "navigated" }.
  2. Fully stop the dev server/environment again (cold start).
  3. In the Browser pane UI, click the "start dev server" button for the same config instead of calling the tool directly. Result: the process starts fine, but the tab navigates to http://localhost:3000/ instead of the configured url.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.220 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS) - Claude Code (desktop app)

Additional Information

  • The launch.json file itself was not modified between the two attempts — same url value present in both cases, confirmed by reading the file after each run.
  • This appears specific to the button-triggered start flow, since invoking preview_start with the same name directly honors the url field correctly.
  • Guessed (unconfirmed) cause: the button may open http://localhost:<port> immediately as a "server is up" placeholder the moment the process starts listening, then fail to follow up with a navigation to the configured url once the router/custom hostname becomes reachable (which can lag slightly behind the raw port).

View original on GitHub ↗