Edit/Write Tool Hangs After User Cancels — File Modified But UI Frozen

Resolved 💬 2 comments Opened Jun 6, 2026 by maximephilippe-ia Closed Jul 13, 2026

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?

  • File modified successfully ✓
  • UI freezes on "update" state with spinner
  • Tokens stop counting
  • No error/log message
  • Session becomes unresponsive

What Should Happen?

Cancel should either:

  • A) Revert file to original state + show confirmation
  • B) Show error message + allow continue
  • C) Complete silently (if file already written)

Error Messages/Logs

Tool result when user cancels:
The user doesn't want to proceed with this tool use. The tool use was rejected
(eg. if it was a file edit, the new_string was NOT written to the file).
STOP what you are doing and wait for the user to tell you how to proceed.
BUT: File IS already written (error message inaccurate)

Steps to Reproduce

  1. Call Edit tool with file modification (e.g., edit test_demo.txt)
  2. Modification request processed normally
  3. User cancels operation with Escape key
  4. File IS modified (change persisted to disk) ✓
  5. Claude Code UI freezes showing "update" with spinning loader
  6. Token counter stops incrementing
  7. No error message appears
  8. Hangs indefinitely — must force quit

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.1.165

Claude Code Version

v2.1.165

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

rien d'intéressant

View original on GitHub ↗

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