@Morgann记录一次claude code修改代码时的报错:File has been unexpectedly modified. Read it again before attempting to write it. 中发帖

[image] 
如图,由于本地的claude code忘了截图了,此图是从解决出截图回来的,效果一样。
claude code在编辑文件的时候总是会提示,文件被意外修改。在尝试写之前再读一遍以及文件被锁定,尝试重新修改。然后陷入一个死循环。
一开始以为是最新版的问题,后降级为2.0.0还是会出现,遂谷歌一下。
终于!!!!!!!
在reddit找到了答案,claude code自身有bug。
解决方案:
在claude.md的prompt中添加一行:“There’s a file modification bug in Claude Code. The workaround is: always use complete absolute Windows paths
with drive letters and backslashes for ALL file opera...