claude-code - 💡(How to fix) Fix [VS Code extension] Add setting to disable auto-opening diff tabs on every 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#52832Fetched 2026-04-25 06:19:43
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
3
Timeline (top)
labeled ×3commented ×1

The Claude Code VS Code extension automatically opens a [Claude Code] <file> diff tab in the editor every time Claude edits or writes a file. There is no user-facing setting to disable this behavior. For sessions that involve many file edits, this quickly fills the editor with stale diff tabs that serve no purpose after the edit is applied.

Please add a setting such as claudeCode.autoOpenDiffs: false (or equivalent) to opt out.

Root Cause

Sessions with frequent file edits become visually noisy. Users repeatedly run into the "close tab = reject edit" trap because there is no intuitive way to dismiss a diff tab. Productivity degrades when the editor area is consumed by stale diffs instead of the code under work.

Fix Action

Fix / Workaround

Workaround attempts that failed

Code Example

{
  "claudeCode.autoOpenDiffs": false   // default: true (current behavior)
}

---

claudeCode.allowDangerouslySkipPermissions
claudeCode.autosave
claudeCode.claudeProcessWrapper
claudeCode.disableLoginPrompt
claudeCode.enableNewConversationShortcut
claudeCode.environmentVariables
claudeCode.hideOnboarding
claudeCode.initialPermissionMode
claudeCode.preferredLocation
claudeCode.respectGitIgnore
claudeCode.useCtrlEnterToSend
claudeCode.usePythonEnvironment
claudeCode.useTerminal
RAW_BUFFERClick to expand / collapse

[VS Code extension] Add setting to disable auto-opening diff tabs on every Edit/Write

Summary

The Claude Code VS Code extension automatically opens a [Claude Code] <file> diff tab in the editor every time Claude edits or writes a file. There is no user-facing setting to disable this behavior. For sessions that involve many file edits, this quickly fills the editor with stale diff tabs that serve no purpose after the edit is applied.

Please add a setting such as claudeCode.autoOpenDiffs: false (or equivalent) to opt out.

Current behavior

  • Every Edit / Write / MultiEdit / NotebookEdit tool call opens a diff preview tab labeled [Claude Code] c:\path\to\file.ext in the editor area.
  • Over a session with ~10 edits, the editor fills with 10+ diff tabs across multiple editor groups.
  • Closing a diff tab via the tab's X button is interpreted as rejecting the edit — the edit does not get applied. This is a UI trap: the only way to make the tab go away without rejecting is to leave it open or use "Close All Editors" after the tool completes.
  • There is no setting to suppress the tab opening.

Expected behavior

A user setting, e.g.:

{
  "claudeCode.autoOpenDiffs": false   // default: true (current behavior)
}

When false:

  • File edits apply silently.
  • No diff tab opens.
  • Edits are visible via git diff or the SCM panel as normal.

Optionally keep an indicator (status bar badge, output channel line) so the user can see edits are happening without the tab proliferation.

Why the existing settings don't solve this

I searched the extension's package.json and tested the available claudeCode.* settings (v2.1.119):

  • claudeCode.useTerminal: true — does not disable the diff tabs. Diffs still open even in terminal mode.
  • claudeCode.initialPermissionMode: "acceptEdits" — auto-accepts edits but tabs still open.
  • No autoOpen, showDiff, diffView, or similar key exists.

The official guidance given by the bundled claude-code-guide agent was "use terminal mode" — but terminal mode does not bypass the diff viewer in practice.

Workaround attempts that failed

  1. Close-tab-on-PostToolUse hook using PowerShell + SendKeys to send Ctrl+W to the VS Code window after each Edit/Write. Fails on split editor groups — Ctrl+PageDown only cycles tabs in the focused group, so diff tabs in other groups are unreachable.
  2. Closing the tab with X manually — triggers edit rejection (see above). The tab cannot be dismissed without cost once opened, without using "Close All Editors".

Environment

  • VS Code extension version: anthropic.claude-code-2.1.119-win32-x64
  • OS: Windows 11
  • Shell: bash + PowerShell

Impact

Sessions with frequent file edits become visually noisy. Users repeatedly run into the "close tab = reject edit" trap because there is no intuitive way to dismiss a diff tab. Productivity degrades when the editor area is consumed by stale diffs instead of the code under work.

Related

The extension's setting list (as of v2.1.119):

claudeCode.allowDangerouslySkipPermissions
claudeCode.autosave
claudeCode.claudeProcessWrapper
claudeCode.disableLoginPrompt
claudeCode.enableNewConversationShortcut
claudeCode.environmentVariables
claudeCode.hideOnboarding
claudeCode.initialPermissionMode
claudeCode.preferredLocation
claudeCode.respectGitIgnore
claudeCode.useCtrlEnterToSend
claudeCode.usePythonEnvironment
claudeCode.useTerminal

None control diff-tab auto-open.

extent analysis

TL;DR

Add a setting to the Claude Code VS Code extension to disable auto-opening diff tabs on every edit/write.

Guidance

  • The extension's current behavior can be modified by adding a new setting, such as claudeCode.autoOpenDiffs, to opt out of auto-opening diff tabs.
  • To verify the fix, test the extension with the new setting and ensure that diff tabs no longer open automatically.
  • Consider adding an indicator, such as a status bar badge or output channel line, to notify the user of edits without opening a diff tab.
  • Review the extension's code to ensure that closing a diff tab does not reject the edit.

Example

{
  "claudeCode.autoOpenDiffs": false
}

This setting would disable auto-opening diff tabs when set to false.

Notes

The existing settings, such as claudeCode.useTerminal, do not solve this issue, and the official guidance to use terminal mode does not bypass the diff viewer.

Recommendation

Apply a workaround by adding a custom setting to the extension, such as claudeCode.autoOpenDiffs, to disable auto-opening diff tabs. This would allow users to opt out of the current behavior and improve productivity.

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…

FAQ

Expected behavior

A user setting, e.g.:

{
  "claudeCode.autoOpenDiffs": false   // default: true (current behavior)
}

When false:

  • File edits apply silently.
  • No diff tab opens.
  • Edits are visible via git diff or the SCM panel as normal.

Optionally keep an indicator (status bar badge, output channel line) so the user can see edits are happening without the tab proliferation.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING