claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Edit preview/diff not showing in VSCode extension UI when confirming changes

Open apinanaivot opened this issue 2 months ago • 11 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using the Claude Code VSCode extension, edit previews are not visible when confirming code changes. The UI prompts me to confirm changes but only shows the file in its current state, without displaying the diff/preview of what will be changed.

  • Confirmation dialog appears
  • File opens in current state without showing the diff
  • No preview of what will change is visible
  • Changes work correctly once confirmed, but I can't see what I'm confirming

The same functionality works perfectly when running Claude Code via terminal in VSCode. The diff preview displays as expected.

What Should Happen?

Should show a diff/preview of the proposed changes before confirmation, similar to the terminal CLI version.

Error Messages/Logs

This is visible in vscode dev tools console, not sure if relevant. It says failed to apply edit even though It doesn't fail if I accept it.


index.js:1008 Uncaught (in promise) Error: String not found in file. Failed to apply edit.
    at uX.readMessages (index.js:1008:30299)
localProcessExtensionHost.ts:280 Extension Host
localProcessExtensionHost.ts:281 Claude Code stderr: [DEBUG] "Permission suggestions for Edit: [\n  {\n    \"type\": \"setMode\",\n    \"mode\": \"acceptEdits\",\n    \"destination\": \"session\"\n  }\n]"

Steps to Reproduce

  1. Open VSCode with Claude Code extension
  2. Request code changes via the extension UI
  3. Observe confirmation prompt - diff preview is not visible
  4. Compare with terminal CLI version where diff shows correctly

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.0.1 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Image

VSCode Version: 1.104.2 (e3a5acfb517a443235981655413d566533107e92 x64)

apinanaivot avatar Oct 01 '25 15:10 apinanaivot

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8509
  2. https://github.com/anthropics/claude-code/issues/8224
  3. https://github.com/anthropics/claude-code/issues/1317

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

github-actions[bot] avatar Oct 01 '25 15:10 github-actions[bot]

Same issue with me

parnexcodes avatar Oct 14 '25 17:10 parnexcodes

Same issue

gelnor avatar Oct 30 '25 08:10 gelnor

Same, was good even yesterday

elfenlieds7 avatar Nov 07 '25 00:11 elfenlieds7

Guys you are supposed to upvote this if you have the same issue, not comment "same"

apinanaivot avatar Nov 07 '25 07:11 apinanaivot

Looks like this hasnt been fixed. Is there a work around?

Manish-Pradhan-FP avatar Nov 19 '25 14:11 Manish-Pradhan-FP

I use the terminal in visual studio rather than the claude code extension. That works like before.

apinanaivot avatar Nov 19 '25 19:11 apinanaivot

Could we bring this to the developers’ attention? The terminal version works, but it has some visual issues, and the extension is currently unavailable for me.

gelnor avatar Nov 20 '25 06:11 gelnor

I use terminal and the diff is suddenly disappearing. But the claude code plugin is still working

stanfordpeng avatar Nov 26 '25 03:11 stanfordpeng

Same issue here. Any workarounds?

cr4z avatar Dec 02 '25 04:12 cr4z

Upvoted.

This also happens here.

Shows diff editor when using Linux, VS Code, Claude Code Extension.

Shows diff editor when using Windows, VS Code, Claude Code Terminal.

Doesn't show diff editor when using Windows, VS Code, Claude Code Extension. Or to be more precise, it shows very sporadically, like once in 50 edits or more.

edsonbrusque avatar Dec 09 '25 18:12 edsonbrusque