今天让Claude code写一个Chrome插件。 任何页面按两下a,自动变成清爽的阅读模式。 写的过程发现Claude code替换文件经常出错,Google查询发现很多人遇到类似问题。 原因是制表符缩进问题,造成replace不管用。 可以告诉Claude Code,把下面要求写入md文件,作为其中一条开发规则: Instead of doing an "in-file" replacement, just write a new copy of the file from scratch, keeping the full content except for the segment you need to replace, and write that in accordingly 问题完美解决,操作演示见下面视频。 Chrome插件源代码已开源,见评论第一条。