Frequent “Error editing file” on Update

Resolved 💬 19 comments Opened Aug 16, 2025 by musaev-haybulla Closed Aug 16, 2025

Recently, I have started to frequently experience the following error in Claude Code when trying to update files:

Update(add_poem_fragment.php)
⎿  Error editing file

⏺ Read(add_poem_fragment.php)
⎿  Read 10 lines (ctrl+r to expand)

The problem also occurs with other files. This happens even if I immediately try to update after reading (no apparent external modification). The “Read” command works (e.g., Read(add_poem_fragment.php)), but “Update” often fails, making it impossible to edit files reliably.

Why?? It's critical?

View original on GitHub ↗

19 Comments

github-actions[bot] · 11 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3513
  2. https://github.com/anthropics/claude-code/issues/3471

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

etherbound-dev · 11 months ago

this is also happening to me - just started today

pujan789 · 11 months ago

Same error for me

quancore · 11 months ago

same

herfate · 11 months ago

same, and no more error messages

haoranaaa · 10 months ago

+1 the same error !

Ubeydu · 10 months ago

I also got that error very frequently and I asked Claude Code, here is its response:

The "Error editing file" occurred because I tried to use the Edit tool on files I hadn't read first in that session. The Edit tool requires reading a file with the Read tool before making changes to it - this is a safety feature to ensure I understand the file's current state before modifying it. I should have been more careful to always read files first, but the errors didn't block our progress since I caught and corrected them by reading the files before editing.

This sounds plausible to me.

gyanraj06 · 10 months ago

any idea on fixing that - guys?

foerster · 10 months ago

I had this issue in the past, then it went away, and now today clause code is unusable, throwing this error over and over. I closed, reopened, tried a simple 'add one character to index' prompt and same issue.

currently completely broken.

GukDev · 10 months ago

Agree, happens every session for over a week. Burning usage.

Eisermann · 10 months ago

Same for me, still hapenning, making claude code barely usable and causes issues - e.g. duplicated code - once it adds it using "update" and later has error anyway and appends it in end of file

johnmiroki · 10 months ago

Error editing file
Error reading file
Error... the file ops are broken

TP-113 · 10 months ago

+1 same error

⏺ Update(test/repository/storage_upload_helper_test.dart)
  ⎿  Error editing file

⏺ Update(test/repository/storage_upload_helper_test.dart)
  ⎿  Error editing file
Ethorsen · 10 months ago

Same happening here. It is sporadic and seem random. File claude is trying to modify is never locked nor opened by another app.

Why this is an important issue is that CLAUDE does not seem to notice the error that it could not write the modifs. So we end up with partial/broken modifs at the end.

treasure567 · 10 months ago

deleting the file and recreating it worked for me

mgoulet101 · 10 months ago

I found that disabling vscode formatOnSave "fixes" it. It's not a long term solution, but I'm feeling like it's a race with file formatters and CC. I haven't tried running CC outside of vscode.

But absolutely, this problem comes and goes, and then it sort of gets past using cat or sed. It's a pretty big problem.

mgoulet101 · 10 months ago

Any update on this? It's a real problem and as discussed on https://github.com/anthropics/claude-code/issues/6595 (which I think is a dup of this), it seems to have nothing to do with vscode's formatOnSave or prettier or anything like that.

june991012 · 10 months ago

same error for me! it really annoys me

github-actions[bot] · 9 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.