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

Resolved 💬 3 comments Opened Apr 24, 2026 by Mig-Sornrakrit Closed Apr 28, 2026

[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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗