claude-code - 💡(How to fix) Fix Feature request: Add OpenFile tool to open files in IDE editor without editing [1 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#52167Fetched 2026-04-23 07:34:51
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Add an OpenFile (or RevealFile) tool that opens a file in the IDE editor for viewing, without requiring an edit operation.

Root Cause

Add an OpenFile (or RevealFile) tool that opens a file in the IDE editor for viewing, without requiring an edit operation.

RAW_BUFFERClick to expand / collapse

Summary

Add an OpenFile (or RevealFile) tool that opens a file in the IDE editor for viewing, without requiring an edit operation.

Motivation

The Claude Code VSCode extension already surfaces files in the editor as a side effect of the Edit and Write tools (showing a diff for approval). However, there is no way to open a file for read-only viewing — the only way to trigger the IDE to show a file is to propose a change to it.

This creates an odd gap: Claude can read any file, but cannot show it to the user in their editor without fabricating an edit. A standalone OpenFile tool would close this gap naturally.

Proposed behavior

  • OpenFile(file_path) — opens the file in the active IDE editor tab, read-only, no diff view
  • Available in VSCode extension (and ideally JetBrains) environments
  • When the IDE is not available (terminal), gracefully no-ops or falls back to printing the path

Example use case

User: "Can you open my settings file so I can review it?" Claude: calls OpenFile("/Users/npantier/.claude/settings.json") Result: file opens in editor tab

Currently this is impossible without making an unnecessary edit.

extent analysis

TL;DR

Implement an OpenFile tool that takes a file path as input and opens the file in the IDE editor for read-only viewing.

Guidance

  • Define the OpenFile function with a file_path parameter to handle the file opening logic.
  • Check if the IDE is available (e.g., VSCode or JetBrains) and use its API to open the file in a read-only editor tab.
  • Handle the case where the IDE is not available (e.g., terminal) by either no-op or printing the file path.
  • Integrate the OpenFile tool with the Claude Code VSCode extension to enable seamless file viewing.

Example

function OpenFile(file_path) {
  // Check if IDE is available (e.g., VSCode)
  if (isVSCodeAvailable()) {
    // Use VSCode API to open file in read-only editor tab
    vscode.window.showTextDocument(vscode.Uri.file(file_path), { preview: true });
  } else {
    // Handle case where IDE is not available (e.g., terminal)
    console.log(`File path: ${file_path}`);
  }
}

Notes

The implementation details may vary depending on the specific IDE and its API. This example assumes a VSCode environment, but the approach should be adaptable to other IDEs like JetBrains.

Recommendation

Apply workaround by implementing the OpenFile tool as described, allowing users to view files in their IDE editor without requiring an edit operation.

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

claude-code - 💡(How to fix) Fix Feature request: Add OpenFile tool to open files in IDE editor without editing [1 participants]