[FEATURE] Inline per-change diff approval UI in VSCode extension (accept/discard individual hunks)

Resolved 💬 3 comments Opened Mar 6, 2026 by swheettaos Closed Mar 9, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When Claude Code makes edits across one or more files, all changes are applied atomically. If I agree with most of a change but want to reject or tweak one specific hunk, my only options are:

  • Accept everything and manually revert the parts I don't want
  • Reject everything and re-prompt

This makes it harder to trust Claude with larger edits, because there's no fine-grained control. I find myself being more conservative about what I ask Claude to change in a single session to reduce the risk of unwanted edits slipping through.

Proposed Solution

In the VSCode extension, when Claude Code makes file edits, present an inline diff view similar to GitHub Copilot's suggestion UI, with two key elements:

1. Visual highlighting of changes in the editor

  • Added lines highlighted in green directly in the editor gutter/background (like Copilot inline suggestions)
  • Removed lines shown in red with strikethrough or in a ghost overlay
  • Changed hunks visually grouped and clearly delimited so it's obvious where each discrete change begins and ends
  • Active tracking as Claude applies changes — highlights appear in real time as each hunk is written, not just as a final diff at the end

2. Per-hunk accept/discard controls

  • Each changed hunk has inline Accept / Discard buttons (or keyboard shortcuts) directly in the editor margin
  • Accepting a hunk commits just that change and removes its highlighting
  • Discarding a hunk reverts just that portion to the original
  • A summary bar (like Copilot's) shows how many hunks are pending review across all modified files

Alternative Solutions

Currently working around this by:

  • Using git diff after the fact and manually reverting hunks with git checkout -p
  • Asking Claude to make smaller, more targeted edits to reduce the surface area of unwanted changes

GitHub Copilot solves this with an inline accept/reject UI directly in the editor when it suggests code changes, which makes it easy to cherry-pick only the parts you want.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I ask Claude to fix a bug and reduce log verbosity across several files
  2. Claude modifies 3 files correctly but also changes a comment in a 4th file I didn't want touched
  3. With per-hunk approval + live highlights, I can see exactly what changed as it happens, then accept the 3 correct hunks and discard the unwanted one in one smooth flow
  4. Without it, I have to either accept all changes and manually revert, or reject all and re-prompt more carefully

Additional Context

Similar UX exists in:

  • GitHub Copilot (VSCode) — inline green highlighting + accept/discard per suggestion, live as suggestions appear
  • git add -p — hunk-by-hunk staging in the terminal
  • GitLens — per-line change controls in the gutter
  • Cursor — inline diff view with accept/reject per change block

The existing diff panel in the Claude Code VSCode extension is a good foundation. The key additions would be:

  1. Real-time visual highlighting in the editor itself (not just a separate diff panel)
  2. Per-hunk accept/discard controls inline in the editor margin

View original on GitHub ↗

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