[BUG] [VS Code Extension]: Chat file links open a spurious external browser tab in web/code-server (missing stopPropagation)

Status Open
Reported on v2.1.212
Maintainer reply None cached
Activity 1 comment · opened Jul 17, 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?

Clicking a markdown file reference in the chat panel opens a spurious second browser tab in addition to jumping to the file.

The jump itself works correctly — the file opens and the line range is highlighted — but the same click also gets handled by VSCode's own webview link handler, which opens the href externally. In code-server that means a new browser tab showing the host's 404 page, on every single click. The same bug exists in the desktop app but is invisible there, because the external open of a bogus path is a silent no-op.

Root cause: in webview/index.js the link click handler calls preventDefault() but never stopPropagation():

let s=(c,d)=>{if(!d||!t?.fileOpener)return;let u=fN(d);if(u)c.preventDefault(),t.fileOpener.open(u.filePath,{startLine:u.startLine,endLine:u.endLine})}

The native event therefore keeps bubbling to VSCode's document-level webview listener, which fires on any <a href>, does not check defaultPrevented, and posts did-click-link to the host.

Fix: add c.stopPropagation() next to the preventDefault(). I patched the bundle locally and verified — the jump still works, the extra tab is gone.

What Should Happen?

Clicking a file reference should jump to the file and highlight the range — and nothing else. No second tab, no external navigation.

Error Messages/Logs

No errors in the developer console or the extension log.

The extra tab shows the code-server host's plain 404 page for the requested path, e.g. `/config/workspace/mand/owfop/E850.FO2` resolved against the code-server URL. With a `file://` href the tab comes up blank instead, because the browser looks for the path on the local machine rather than on the server.

Steps to Reproduce

Environment: Claude Code VSCode extension 2.1.212, code-server (VSCode in the browser) code-server: v4.127.0, Code: 1.127.0, Linux.

  1. Run VSCode in the browser via code-server, with the Claude Code extension installed.
  2. Get Claude to emit a markdown file reference in chat, e.g. [file.ts:42](/abs/path/to/file.ts#L42) — asking it about any file in the workspace usually produces one.
  3. Click the link.
  4. The file opens at the correct line and a second browser tab opens showing a 404.

Claude Model

_No response_

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

VSCode extension 2.1.212

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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