[FEATURE] amend a proposed file edit in $EDITOR before it's written

Resolved 💬 2 comments Opened Jun 23, 2026 by undont Closed Jun 26, 2026

Problem Statement

the Write/Edit approval prompt is binary today (approve / approve-all / reject). when a proposed edit is 90% right but needs a small correction (rename a var, fix a path, drop a stray line), the only options are reject and re-prompt in prose, then wait on a full re-propose. there's no way to just fix the proposed change in place before it's written.

Proposed Solution

add an amend option at the Write/Edit approval prompt (e.g. ctrl+g) that opens the proposed content in $VISUAL/$EDITOR:

  • for a write, the new file
  • for an edit, the file with the pending hunk applied, opened at the hunk

on save and quit, claude applies the amended version instead of its original proposal, and the tool result reflects the actual applied content so the model's exact-match view of the file stays in sync (it sees the real post-edit state, not its original proposal).

Alternative Solutions

i looked at doing this with hooks. PreToolUse can rewrite tool input via updatedInput, but hooks run with no controlling tty and a json-in/json-out contract, so they can't open an interactive editor and block on a human edit. the approval prompt is a closed ui with no keybinding or plugin hook to hand off to $EDITOR. so this needs first-party support in the prompt and the event loop: suspend the tui, give up the real tty, edit, resume, parse the result back into the tool call.

Use Case Example

  1. claude proposes an Edit that's correct except it renames a function i wanted to keep
  2. i press ctrl+g at the approval prompt
  3. the file opens in $EDITOR with the pending hunk applied, cursor at the hunk
  4. i fix the one line, save, quit
  5. claude writes my amended version, and its next edit uses the real post-edit content, no desync

Additional Context

priority: medium. category: interactive mode (tui) / file operations.

env: claude code 2.1.186, macos.

View original on GitHub ↗

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