claude-code - 💡(How to fix) Fix VS Code: Add setting to disable auto-navigation to file on Edit/Write [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#56229Fetched 2026-05-06 06:33:42
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Fix Action

Fix / Workaround

  • preserveFocus: true alone isn't enough — the tab still appears and steals visual attention even if focus is preserved
  • Pinning the chat tab — workaround, not a fix
RAW_BUFFERClick to expand / collapse

Problem

When Claude Code makes edits via the Edit or Write tool in VS Code, the extension automatically opens a diff tab and navigates focus away from the chat panel. This forces users to manually navigate back to the chat to continue the conversation.

For users working in the VS Code chat panel, this creates a disruptive workflow — every edit causes a context switch. When Claude makes multiple edits in sequence, the user has to repeatedly navigate back.

Proposed Solution

Add a VS Code extension setting (e.g., claudeCode.autoRevealEdits) that controls whether diff tabs are automatically opened/focused when edits are made.

Options:

  • true (default, current behavior): Open diff tab on every edit
  • false: Don't auto-open diff tabs; user can review diffs on demand

The relevant code path is the vscode.diff command execution with {preview: false, preserveFocus: true} options. When the setting is false, this command would simply be skipped.

Alternatives Considered

  • preserveFocus: true alone isn't enough — the tab still appears and steals visual attention even if focus is preserved
  • Pinning the chat tab — workaround, not a fix

Use Case

Power users who trust Claude's edits and want to stay in the chat flow, reviewing diffs only when needed (e.g., via source control panel or git diff).

extent analysis

TL;DR

To prevent the diff tab from automatically opening and navigating focus away from the chat panel, add a VS Code extension setting claudeCode.autoRevealEdits with an option to disable auto-opening of diff tabs.

Guidance

  • Introduce the claudeCode.autoRevealEdits setting with true as the default behavior and false to disable auto-opening diff tabs.
  • Modify the code path executing the vscode.diff command to respect the new setting, skipping the command when claudeCode.autoRevealEdits is false.
  • Test the new setting with both true and false values to ensure the desired behavior.
  • Consider adding a notification or indicator when claudeCode.autoRevealEdits is false to remind users that edits have been made and are available for review.

Example

const autoRevealEdits = vscode.workspace.getConfiguration('claudeCode').get('autoRevealEdits');
if (autoRevealEdits) {
  // Execute vscode.diff command with current options
} else {
  // Skip executing vscode.diff command
}

Notes

The proposed solution assumes that the vscode.diff command is the sole cause of the diff tab opening. If other factors contribute to this behavior, additional modifications may be necessary.

Recommendation

Apply the workaround by introducing the claudeCode.autoRevealEdits setting, as it directly addresses the user's need to control the diff tab behavior and stay focused on the chat panel.

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