[CRITICAL] Version 2.0.50 performs full file rewrites instead of targeted edits - 20x performance regression

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 10 comments · opened Nov 22, 2025 · closed Nov 24, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

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?

Title: [CRITICAL] Version 2.0.50 performs full file rewrites instead of targeted edits - 20x performance regression
Environment:

Platform: Windows 10/11
Claude Code Version: 2.0.50
Installation Method: npm global install
Working Version: 2.0.49

Bug Description:
Version 2.0.50 has a critical regression where it performs complete file rewrites for every edit instead of using targeted string replacements. This makes Claude Code completely unusable for any non-trivial codebase.
Evidence:
When making a simple edit to a large file (~2,300 lines), Claude Code shows:

Lines changed: ±18668 -18575 (essentially rewriting the entire file)
Token usage: 47,642 tokens for a single minor edit
Performance: 20x slower than version 2.0.49

Screenshot attached showing the massive line count changes at the bottom of the terminal.
Expected Behavior (v2.0.49):

Targeted edits using str_replace mechanism
Only the specific changed lines appear in git diff
Token usage: hundreds of tokens for typical edits
Fast response times

Actual Behavior (v2.0.50):

Complete file rewrite for every edit
Git diffs show thousands of lines changed
Token usage: tens of thousands of tokens per edit
Unusably slow performance (minutes per simple edit)
"Clauding... (esc to interrupt · 1m 37s · ↑ 520 tokens)" for trivial operations

Impact:

Makes Claude Code completely unusable for production codebases
Massive token waste (100x increase in token consumption)
Git history becomes polluted with false "full file changes"
Development velocity drops to near zero

Workaround:
bashnpm install -g @anthropic-ai/claude-code@2.0.49
Set DISABLE_AUTOUPDATER=1 environment variable to prevent auto-update back to 2.0.50.
Additional Context:
This appears to be a regression in the str_replace mechanism. Instead of finding and replacing specific strings, it's reading and rewriting entire files. This may have been introduced as part of changes to the file editing system between 2.0.49 and 2.0.50.
Suggested Priority: Critical - This blocks all productive use of Claude Code for real-world codebases.

What Should Happen?

not rewrite the entire freaking file!

Error Messages/Logs

Steps to Reproduce

Reproduction:

Install Claude Code 2.0.50
Open any project with files >500 lines
Ask Claude to make a simple edit (change one function, fix one bug, etc.)
Observe the massive line count changes and token usage at bottom of terminal

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.0.49

Claude Code Version

v.2.0.50

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

<img width="1280" height="686" alt="Image" src="https://github.com/user-attachments/assets/dded3da4-6cc4-4981-a046-02ac1a4f6338" />

View original on GitHub ↗

10 Comments

Ahahahahaa121 · 9 months ago

same problem from yesterday

virtualisoftware · 9 months ago

Yes, same here, the number of lines rewritten is almost the same as the lines removed, and it takes several minutes to make simple edits.

saiyedEnacton · 9 months ago

Same here Now it taking even an hour or so just for normal edit and stuff

TheAuditorTool · 9 months ago

Same here. Even updated to preview 7.6.0 powershell and reinstalled completely, deleted all .claude folders, all settings, all history... Still nightmare slow and its not the model, its the client that freezes...
Likely related to bun memory issues as always because closing and running a fresh chat gives you 5-10 minutes of normal speed.

artnikbrothers · 9 months ago

Agree. It happens for me as well.

shehan011 · 9 months ago

Same thing happened to me as well.
From my understanding Instead of keeping just the changes we make to a file in the context, Claude tries to keep the whole file... that's why we see the 2 files +18k -18k....
Weirdly using a custom made agent kind has fixed the issue for me.

warpdevv · 9 months ago

Same for me +1

bcherny collaborator · 9 months ago

Fix incoming

bcherny collaborator · 9 months ago

Fixed in 2.0.51

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.