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

Model is unaware of manual editing of diff viewer in IDE

Open OverHash opened this issue 7 months ago • 10 comments

When using Claude Code in an IDE (i.e., inside a VSCode terminal with the IDE integration), Claude Code will propose changes via a diff viewer tab in vscode.

While this is a nice integration, the developer experience is janky when trying to manually tweak changes before accepting them.


Currently, there is no way to make a change to the proposed changes by Claude Code in the diff viewer without Claude Code missing the change.

Image

Specifically, Claude Code will open a diff tab and the user can press "accept proposed changes", which will trigger the same thing as typing 1 in the terminal window ("Yes" to "Do you want to make this edit to ?").

If, however, the user edited the proposed change (e.g., removed a comment proposed by claude code, but wants to accept all the other changes), and then presses "accept proposed changes", they will be left with only the changes that claude code proposed -- and will have to save the file again, and then tell claude code that they made changes (to get the model to read the file again) before proceeding.

Effectively, the developer must choose "No, and tell Claude what to do differently", and tell claude to make the same change that they otherwise wanted to (to get the diff viewer to work nicely).


If the developer could edit the proposed changes in the diff viewer, then press the "Accept proposed changes" button in the IDE, and both the claude changes and the developer manual edits to the claude changes were accepted at once, this experience would be more pleasant.

OverHash avatar May 26 '25 01:05 OverHash

hey @OverHash, this should already be possible. If you edit the proposed content within the diff viewer, your edits should be applied when it saves. Please give it a try and see if that's the case for you!

hackyon-anthropic avatar May 28 '25 02:05 hackyon-anthropic

Hey @hackyon-anthropic, I'll attach some videos to better explain.

https://github.com/user-attachments/assets/07f8cafd-c80d-4b96-b3af-cd7dae81fa94

Video 1 here shows us using Claude Code to add some items to a file, but we make a manual edit (adding strawberry).

First UX problem arises when we accept the proposed changes -- we are also asked by vscode to save the file. I just tested and it seems that no matter what you do, the changes will be saved (which is good, but clunky UI -- would be ideal if vscode didn't prompt to save the file here at all after we accept the changes).

https://github.com/user-attachments/assets/184e6606-8679-46d6-b09c-88f0acf5b2d9

Video 2 here shows proof of rejecting the change doesn't do anything.

However, the core problem remains in either case: vscode applies the manual edits made in the diff viewer, but the model has no idea about those changes. this can cause issues because the context the model uses is essentially poisoned.

Here's the full transcript of the conversation:

> Create a new text file called "shopping.txt" and add "mangos, oranges, bananas" to it, each on a new line.

● Write(file_path: shopping.txt)…
  ⎿ Wrote 4 lines to shopping.txt
     mangos
     oranges
     bananas
     strawberry

● Created shopping.txt with the requested items on separate lines.

<-- manual note: this is the result after the first video. we also added strawberry manually -->

> Okay, now remove bananas.

● Update(shopping.txt)…
  ⎿  Updated shopping.txt with 1 addition and 3 removals
     1  mangos
     2  -oranges
     3  -bananas
     4  -strawberry
     2 \ No newline at end of file
     3  +oranges
     4 \ No newline at end of file

● Removed bananas from the shopping list.

<-- manual note: this is the result after the second video. we also manually removed strawberry -->

> What were the changes we just made? Don't do any tool uses

● We created a shopping.txt file with three items (mangos, oranges, bananas) each on separate lines, then removed bananas from the list, leaving only mangos and oranges.

Clearly the model had no idea about strawberries.

This causes problems because as a developer I must then instruct the model to read the file again and look for manual changes I made:

> Did I ever add an extra fruit compared to just mangos, oranges, and bananas as we have discussed?

● No, you never added any extra fruit. We only worked with the three fruits you originally specified: mangos, oranges, and bananas. We created the file with those three items and then removed bananas, leaving
  mangos and oranges.

so although the output of Claude Code shows that during the file write operations we apply the manual edits from vscode git diff, this is not integrated into the model conversation context, and so the model does not understand manual edits made.

OverHash avatar May 28 '25 02:05 OverHash

Accordingly perhaps this issue should be renamed after my triaging just now. Maybe "Integrate manual edits in diff viewer into model conversation" is more appropriate.

OverHash avatar May 28 '25 02:05 OverHash

I'm experiencing the same issue, repeatedly, on Windsurf.

Clicking the "approve changes" in the IDE does reflect my changes in the terminal though Windsurf asks me if I want to save my changes (odd).

However, if I modify the suggestion and press one (1) in the terminal, my changes are not saved nor show in the terminal diff. If Claude suggest a change and I edit the file and instead do Cmd+S, it behaves like typing one (1) it proceeds but ignores my changes.

So in conclusion, the only way to have Claude keep my changes in context is by clicking "approve changes" and confirming the save operation on Windsurf (even if the terminal already moved forward).

quezadaesteban avatar Jun 03 '25 16:06 quezadaesteban

Enhanced Diff View Integration: Make Claude aware of user edits

I opened a related issue that was closed as duplicate, but I believe this overlaps with the core problem described here.

Current Problem

Claude proposes changes via diff view, but when developers manually edit those changes before accepting, Claude is unaware of the modifications. This leads to Claude saying things like "Wait, it seems like I made a mistake in my last edit" and attempting to undo user improvements.

Proposed Solution

Change Claude Code's assumption from "see if the user agrees to the change" to "incorporate any additional changes or corrections the user makes."

Workflow

  1. Direct Edit Support - Allow developers to modify proposed changes in diff view
  2. Change Detection - Detect when developers have modified the proposed changes
  3. Collaborative Dialog - When modifications are detected, Claude should:
    • Acknowledge the developer's changes
    • Ask clarifying questions about the intent
    • Incorporate refinements into the final implementation
    • Generalize the pattern to other applicable locations

Why This Matters

  • Enables "show, don't tell" collaboration through concrete code changes
  • Creates tighter feedback loops between human and AI
  • Reduces back-and-forth prompt iterations
  • Allows complex requirements to be communicated through example modifications

Use Case Example

  1. Claude proposes a function implementation
  2. Developer sees it's 90% correct but tweaks the error handling in diff view
  3. Claude recognizes the modification: "I see you changed the error handling approach - would you like me to apply this pattern to similar functions?"
  4. Developer confirms, Claude applies the refined approach consistently

Suggested thread title: Feature Request: Enable Claude awareness of user edits in VS Code Diff View

diraneyya avatar Sep 13 '25 11:09 diraneyya

Even in 1.0.126, Claude always writes its originally suggested code changes despite me making changes within the VS Code diff editor.

  1. Claude suggestion within VS Code diff: "Foo"

  2. User edit to Claude suggestion within VS Code diff: "Foo Bar"

  3. User manually accepts change

  4. Claude still writes "Foo"

dklanac avatar Sep 26 '25 09:09 dklanac

Even in 1.0.126, Claude always writes its originally suggested code changes despite me making changes within the VS Code diff editor.

  1. Claude suggestion within VS Code diff: "Foo"
  2. User edit to Claude suggestion within VS Code diff: "Foo Bar"
  3. User manually accepts change
  4. Claude still writes "Foo"

In my case, it seems to assume that it had made a mistake, which means it is not made aware of this diff view as an opportunity to give feedback, which is the issue.

diraneyya avatar Sep 26 '25 11:09 diraneyya

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]