saoudrizwan / claude-dev

Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.
https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev
MIT License
4.04k stars 381 forks source link

Update ClaudeDev.ts to correct code/comment removing behavior #165

Closed zyzhang1130 closed 2 weeks ago

zyzhang1130 commented 2 weeks ago

I noticed very often when proposing changes to the existing code, Claude Dev simply uses the line // ... [rest of the file content remains unchanged until the writeToFile method] to replace a large chunk of original code that is not supposed to be removed. This behavior is often seen in sonnet 3.5 api from my experience, but for Claude Dev's use case this has to be changed. Similarly sonnet 3.5 also tends to remove existing comments which I also find counter-productive. Hence I added two additional rules to counter these behaviors.

saoudrizwan commented 2 weeks ago

I have improved the system prompt in v1.4.17 to better guard against lazy coding. Please give that a try and let me know if it's any better.