claude-code - 💡(How to fix) Fix VS Code: File links in chat stop working after closing the file tab [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52261Fetched 2026-04-24 06:11:52
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

When Claude Code creates or references a file in a chat response, the markdown link auto-opens the file on first click. However, after closing that file tab, clicking the same link again does nothing — the file does not reopen.

Root Cause

When Claude Code creates or references a file in a chat response, the markdown link auto-opens the file on first click. However, after closing that file tab, clicking the same link again does nothing — the file does not reopen.

RAW_BUFFERClick to expand / collapse

Description

When Claude Code creates or references a file in a chat response, the markdown link auto-opens the file on first click. However, after closing that file tab, clicking the same link again does nothing — the file does not reopen.

Steps to reproduce

  1. Ask Claude to create a document (Word, PDF, or any file type)
  2. Claude outputs a clickable markdown link to the file in the chat
  3. File auto-opens (or opens on first click) — works correctly
  4. Close the file tab
  5. Click the same link in the chat again
  6. Nothing happens — file does not reopen

Expected behaviour

Clicking the link should reopen the file every time, regardless of how many times the tab has been closed and reopened.

Environment

  • VS Code extension
  • macOS (Darwin 25.3.0)
  • Happens with all file types: .docx, .pdf, .sql, etc.

extent analysis

TL;DR

The issue might be resolved by adjusting the link handling mechanism in the VS Code extension to properly reopen files on subsequent clicks.

Guidance

  • Investigate the link handling logic in the VS Code extension to ensure it correctly handles repeated clicks on the same link.
  • Verify if the issue is specific to the macOS environment or if it occurs on other platforms as well.
  • Check if there are any event listeners or handlers attached to the link that might be preventing the file from reopening on subsequent clicks.
  • Consider adding a debug log to track the behavior of the link handling mechanism to gain more insights into the issue.

Example

No code snippet can be provided without more context about the extension's codebase.

Notes

The issue might be related to how the VS Code extension handles file links and their lifecycle, particularly on macOS. Without access to the extension's code, it's challenging to provide a precise fix.

Recommendation

Apply a workaround by modifying the link handling logic in the VS Code extension to ensure files reopen on subsequent clicks, as the root cause seems to be related to the extension's behavior rather than a versioning issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING