VS Code diff preview tab regression in v2.1.59–2.1.61

Status Fixed / completed
Reported on v2.1.61
Maintainer reply None cached
Activity 5 comments · opened Feb 27, 2026 · closed Mar 13, 2026

Bug Description

The diff preview that opens in a separate VS Code editor tab when using "ask before edits" mode stopped working after updating to v2.1.59+. Reverting to v2.1.56 restores the expected behavior.

Previous behavior (v2.1.56 and earlier)

When Claude proposes an edit in "ask before edits" mode, a separate diff editor tab opens showing the full file with proposed changes highlighted in context.

Current behavior (v2.1.59–2.1.61)

No diff tab opens. The edit is only shown as a small inline snippet in the chat panel.

Steps to reproduce

  1. Install Claude Code extension v2.1.61
  2. Set permission mode to "ask before edits"
  3. Ask Claude to make an edit to any file
  4. Observe: no diff tab opens in the editor

Workaround

Downgrade to v2.1.56:

code --install-extension anthropic.claude-code@2.1.56 --force

Then disable auto-update for the extension.

Environment

  • VS Code (macOS, Darwin 24.6.0)
  • Claude Code extension v2.1.61 (broken), v2.1.56 (working)
  • The regression was introduced between v2.1.56 (Feb 25) and v2.1.59 (Feb 26)

Related issues

  • #8509 — similar symptom from the v2.0.0 era, but this is a new regression
  • #16297 — diffs not appearing at all
  • #8660 — edit preview/diff not showing

View original on GitHub ↗

5 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8660
  2. https://github.com/anthropics/claude-code/issues/8509
  3. https://github.com/anthropics/claude-code/issues/16297

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

russellgilbert · 5 months ago

Here's a patch script that Claude helped me create to fix the diff preview tab not opening when the file contains CRLFs and a multi-line edit is done.

This script applies two patches to the extension's extension.js file, to convert all CRLFs to LFs before attempting to show the diff tab. This doesn't just force the diff tab to be shown, it normalizes both the existing and new code to use only LFs before the comparison is made for the edit, which allows the diff tab to be shown without an error.

Instructions are included for patching both the Windows extension for editing local files, and the Linux-based extension that's used when editing files via SSH. The script auto-detects the location of the newest Claude Code extension and then backs up the extension.js file before applying the two patches to it. All that's needed after running the script is to reload VS Code, and then the diff preview tab should start working as normal again. See the readme file in the project below for the full instructions.

Give it a try and let us know how it works for you. It finally fixed the problem on both Windows and SSH for me.

https://github.com/russellgilbert/claude-code-diff-fix

bayc-lgtm · 5 months ago

Thank you russellgilbert! The specific bug I was running into seems to have been fixed in the latest version. Not sure if it's the same as the one you fixed.

russellgilbert · 5 months ago
Seems to have been fixed in the latest version.

I can confirm that it is not fixed in extension version 2.1.74 released yesterday (2026-03-12) or in version 2.1.56. One of the problems with this bug is that it sometimes appears to be gone because it only happens when: 1) the file contains CRLFs, and 2) Claude makes an edit that spans across at least two lines.

My patch script above fixes 2.1.74 also though.

But there are several duplicates of this bug so it's probably ok that this issue was closed.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.