Claude Code wrongly thinks source file has been modified or is not writable, wastes all tokens trying multiple workarounds
Bug Description
Sometimes Claude Code erroneously thinks source files have been modified or can't be written to, when in fact the source file is writable, in the same location, and last modified by Claude Code. It tries various workarounds to try to edit and replace the file, wasting all tokens. In my last session, all the tokens in the time window got spent by Claude because of this bug and no work got done, so basically I lost money because of this bug. I'm on Windows and this has happened multiple times in very different projects (C++ vs Python), whether it's a bug in the file access or an issue with the context window, fixing it would prevent users from losing money for no fault of their own. Claude was successfully editing the same file in the same session a few hours earlier and the file is not locked or in use.
Environment Info
- Platform: win32
- Terminal: null
- Version: 2.1.7
- Feedback ID: d65192ac-d952-44e1-abff-5d02f24fa379
Errors
[{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CX9mnAiQxHKJ6xnQhA3Yp\"}\n at generate (B:/~BUN/root/claude.exe:438:33840)\n at makeRequest (B:/~BUN/root/claude.exe:855:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-15T20:12:05.189Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗